about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2019-07-12Rollup merge of #62607 - estebank:this-mem-is-out-of-control, r=petrochenkovMazdak Farrokhzad-2/+3
Correctly break out of recovery loop Fix #61858.
2019-07-11Correctly break out of recovery loopEsteban Küber-2/+3
2019-07-11Emit dropped unemitted errors to aid in ICE debuggingEsteban Küber-6/+7
2019-07-10Remove needless indent argumentsMark Rousskov-1/+1
We're always indenting by INDENT_UNIT anyway
2019-07-10Move pp::Printer helpers to direct implMark Rousskov-2/+1
2019-07-05Rollup merge of #62292 - Centril:split-async-closures, r=cramertjMazdak Farrokhzad-15/+21
Move `async || ...` closures into `#![feature(async_closure)]` The `async || expr` syntax is moved out from `#![feature(async_await)]` into its own gate `#![feature(async_closure)]`. New tracking issue: https://github.com/rust-lang/rust/issues/62290 Closes https://github.com/rust-lang/rust/issues/62214. cc https://github.com/rust-lang/rust/issues/62149 r? @varkor
2019-07-05Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddybbors-9/+9
Remove io::Result from syntax::print Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-07-04Rollup merge of #62258 - petrochenkov:idclean, r=CentrilMazdak Farrokhzad-137/+77
syntax: Unsupport `foo! bar { ... }` macros in the parser Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606. Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly). cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
2019-07-03Add separate 'async_closure' feature gate.Mazdak Farrokhzad-15/+21
2019-07-01Convert more usages overChris Gregory-2/+2
2019-07-01Address review commentsVadim Petrochenkov-48/+45
2019-07-01syntax: Unsupport `foo! bar { ... }` macros in the parserVadim Petrochenkov-93/+36
Unreserve `macro_rules` as a macro name
2019-06-29Always parse 'async unsafe fn' + properly ban in 2015.Mazdak Farrokhzad-8/+18
2019-06-29Remove io::Result from syntax::printMark Rousskov-9/+9
Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-06-26Fix clippy::redundant_field_namesIgor Matuszewski-9/+9
2019-06-25Auto merge of #60732 - jswrenn:arbitrary_enum_discriminant, r=pnkfelixbors-17/+14
Implement arbitrary_enum_discriminant Implements RFC rust-lang/rfcs#2363 (tracking issue #60553).
2019-06-24Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkovbors-2/+2
Remove `ast::Guard` With the introduction of `ast::ExprKind::Let` in https://github.com/rust-lang/rust/pull/60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](https://github.com/rust-lang/rust/issues/51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here. However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...). r? @petrochenkov
2019-06-23Remove redundant syntax::ast::Guard.Mazdak Farrokhzad-2/+2
2019-06-23let_chains: Fix bugs in pretty printing.Mazdak Farrokhzad-2/+2
2019-06-23let_chains: Refactor parse_{if,while}_expr a bit.Mazdak Farrokhzad-9/+12
2019-06-23let_chains: Move feature gating to pre-expansion.Mazdak Farrokhzad-2/+13
2019-06-23let_chains: Fix outdated doc-comment re. 'parse_if_expr'.Mazdak Farrokhzad-1/+1
2019-06-23let_chains: Add support for parsing let expressions.Mazdak Farrokhzad-49/+18
2019-06-21Implement arbitrary_enum_discriminantJohn Wrenn-17/+14
2019-06-18Remove the HirId/NodeId from where clausesMatthew Jasper-2/+0
Also give them a span in the HIR
2019-06-12Auto merge of #61612 - nnethercote:improve-parse_bottom_expr, r=petrochenkovbors-10/+22
Special-case literals in `parse_bottom_expr`. This makes parsing faster, particularly for code with large constants, for two reasons: - it skips all the keyword comparisons for literals; - it skips the allocation done by the `mk_expr` call in `parse_literal_maybe_minus`. r? @petrochenkov
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-28/+52
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-10Special-case literals in `parse_bottom_expr`.Nicholas Nethercote-10/+22
This makes parsing faster, particularly for code with large constants, for two reasons: - it skips all the keyword comparisons for literals; - it replaces the unnecessary `parse_literal_maybe_minus` call with `parse_lit`, avoiding an unnecessary allocation via `mk_expr`.
2019-06-09Allow attributes in formal function parametersCaio-28/+52
2019-06-08syntax: Remove `Deref` impl from `Token`Vadim Petrochenkov-9/+9
2019-06-08syntax: Move most of the `TokenKind` methods to `Token`Vadim Petrochenkov-3/+5
2019-06-07parser: Remove `look_ahead_span`Vadim Petrochenkov-13/+1
2019-06-07parser: Remove `Deref` impl from `Parser`Vadim Petrochenkov-10/+0
2019-06-07parser: `self.span` -> `self.token.span`Vadim Petrochenkov-179/+192
2019-06-06Address review commentsVadim Petrochenkov-4/+8
2019-06-06Some code cleanup and tidy/test fixesVadim Petrochenkov-25/+30
2019-06-06syntax: Switch function parameter order in `TokenTree::token`Vadim Petrochenkov-7/+7
2019-06-06syntax: Remove duplicate span from `token::Ident`Vadim Petrochenkov-27/+21
2019-06-06syntax: Remove duplicate span from `token::Lifetime`Vadim Petrochenkov-4/+3
2019-06-06syntax: Add some helper methods to `Token`Vadim Petrochenkov-10/+10
2019-06-06syntax: Use `Token` in `Parser`Vadim Petrochenkov-79/+82
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-10/+10
2019-06-06syntax: Rename `TokenAndSpan` into `Token`Vadim Petrochenkov-15/+15
2019-06-06syntax: Rename `Token` into `TokenKind`Vadim Petrochenkov-24/+24
2019-06-06Always use token kinds through `token` module rather than `Token` typeVadim Petrochenkov-4/+4
2019-06-05Implemented for function bounds, type bounds, and named existential types.Alexander Regueiro-21/+31
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-29/+29
2019-06-05Auto merge of #61484 - nnethercote:avoid-more-hygiene-lookups, r=petrochenkovbors-8/+11
Avoid more hygiene lookups Mostly by combining multiple `HygieneData::with` calls into a single call on hot paths. r? @petrochenkov
2019-06-05Avoid unnecessary `rust_2018` calls.Nicholas Nethercote-8/+11
The commit combines two calls into one by saving the result in a local variable. The commit also moves the check for `async` later, so that when a different keyword is present the `rust_2018` call will be avoided completely.
2019-06-04Rollup merge of #61500 - estebank:expregression, r=petrochenkovPietro Albini-7/+11
Fix regression 61475 Addresses #61475.