summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
AgeCommit message (Collapse)AuthorLines
2020-10-20rustc_parse: More precise spans for `tuple.0.0`Vadim Petrochenkov-7/+33
2020-10-02Fix span for incorrect pattern field and add labelEsteban Küber-1/+2
2020-09-21fix typo in docs and commentsyuk1ty-1/+1
2020-09-15improve diagnostics for lifetime after `&mut`SNCPlay42-1/+27
2020-09-15Auto merge of #76171 - estebank:turbofish-the-revenge, r=davidtwcobors-6/+66
Detect turbofish with multiple type params missing leading `::` Fix #76072.
2020-09-14Detect turbofish with multiple type params missing leading `::`Esteban Küber-6/+66
Fix #76072.
2020-09-11repairing broken error message and rustfix application for the new testAurélien Deharbe-1/+5
case
2020-09-10Attach tokens to `ast::Stmt`Aaron Hill-5/+15
We currently only attach tokens when parsing a `:stmt` matcher for a `macro_rules!` macro. Proc-macro attributes on statements are still unstable, and need additional work.
2020-09-10Attach `TokenStream` to `ast::Visibility`Aaron Hill-11/+39
A `Visibility` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Attach `TokenStream` to `ast::Path`Aaron Hill-6/+17
2020-09-10Attach tokens to `NtMeta` (`ast::AttrItem`)Aaron Hill-2/+9
An `AttrItem` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Collect tokens when handling `:literal` matcherAaron Hill-1/+9
An `NtLiteral` just wraps an `Expr`, so we don't need to add a new `tokens` field to an AST struct.
2020-09-10Attach `TokenStream` to `ast::Ty`Aaron Hill-6/+23
A `Ty` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Attach `TokenStream` to `ast::Block`Aaron Hill-2/+9
A `Block` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Syntactically permit unsafety on modsDavid Tolnay-16/+51
2020-09-03Rename IsJoint -> SpacingAleksey Kladov-5/+5
To match better naming from proc-macro
2020-09-02Auto merge of #76160 - scileo:format-recovery, r=petrochenkovbors-0/+4
Improve recovery on malformed format call The token following a format expression should be a comma. However, when it is replaced with a similar token (such as a dot), then the corresponding error is emitted, but the token is treated as a comma, and the parsing step continues. r? @petrochenkov
2020-09-02Improve recovery on malformed format callSasha-0/+4
If a comma in a format call is replaced with a similar token, then we emit an error and continue parsing, instead of stopping at this point.
2020-09-01Rollup merge of #76132 - Aaron1011:mac-call-stmt, r=petrochenkovTyler Mandry-2/+2
Factor out StmtKind::MacCall fields into `MacCallStmt` struct In PR #76130, I add a fourth field, which makes using a tuple variant somewhat unwieldy.
2020-08-31Rollup merge of #76115 - calebcartwright:parser-fn-visibility, r=matkladAleksey Kladov-2/+4
Restore public visibility on some parsing functions for rustfmt In #74826 the visibility of several parsing functions was reduced. However, rustfmt is an external consumer of some of these functions as well and needs the visibility to be public, similar to other elements in rustc_parse such as `parse_ident` https://github.com/rust-lang/rust/blob/db534b3ac286cf45688c3bbae6aa6e77439e52d2/src/librustc_parse/parser/mod.rs#L433-L436
2020-08-30Factor out StmtKind::MacCall fields into `MacCallStmt` structAaron Hill-2/+2
In PR #76130, I add a fourth field, which makes using a tuple variant somewhat unwieldy.
2020-08-30Use string literal directly when available in formatSasha-1/+1
Previous implementation used the `Parser::parse_expr` function in order to extract the format expression. If the first comma following the format expression was mistakenly replaced with a dot, then the next format expression was eaten by the function, because it looked as a syntactically valid expression, which resulted in incorrectly spanned error messages. The way the format expression is exctracted is changed: we first look at the first available token in the first argument supplied to the `format!` macro call. If it is a string literal, then it is promoted as a format expression immediatly, otherwise we fall back to the original `parse_expr`-related method. This allows us to ensure that the parser won't consume too much tokens when a typo is made. A test has been created so that it is ensured that the issue is properly fixed.
2020-08-30parser: restore some fn visibility for rustfmtCaleb Cartwright-2/+4
2020-08-30mv compiler to compiler/mark-0/+10401