about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2019-08-01Rollup merge of #63122 - Centril:fix-63115, r=petrochenkovPietro Albini-6/+16
Account for `maybe_whole_expr` in range patterns Fixes https://github.com/rust-lang/rust/issues/63115 (fallout from https://github.com/rust-lang/rust/pull/62550). r? @petrochenkov
2019-07-31Address review comments.Mazdak Farrokhzad-8/+4
2019-07-31cleanup StringReader fieldsAleksey Kladov-12/+11
2019-07-31Replace a few Attribute constructors with mk_attrMark Rousskov-9/+2
2019-07-31Remove AttrId from Attribute constructorsMark Rousskov-2/+2
2019-07-30Point at type ascription before macro invocation on expansion parse errorEsteban Küber-6/+36
2019-07-30Unsupport the await!(..) macro.Mazdak Farrokhzad-39/+30
2019-07-30Rollup merge of #62928 - Centril:recover-parens-around-for-head, r=estebankMazdak Farrokhzad-162/+217
Syntax: Recover on `for ( $pat in $expr ) $block` Fixes #62724 by adding some recovery: ``` error: unexpected closing `)` --> $DIR/recover-for-loop-parens-around-head.rs:10:23 | LL | for ( elem in vec ) { | --------------^ | | | opening `(` | help: remove parenthesis in `for` loop: `elem in vec` ``` The last 2 commits are drive-by cleanups. r? @estebank
2019-07-30Account for maybe_whole_expr in range patterns.Mazdak Farrokhzad-0/+14
2019-07-28Rollup merge of #61856 - c410-f3r:attrs-fn, r=matthewjasperMazdak Farrokhzad-2/+8
Lint attributes on function arguments Fixes #61238. cc #60406
2019-07-28Add 'span_to_snippet' shortcut.Mazdak Farrokhzad-16/+13
2019-07-28Use chaining for diagnosics in parser.Mazdak Farrokhzad-152/+155
2019-07-28Recover 'for ( $pat in $expr ) $block'.Mazdak Farrokhzad-0/+55
2019-07-28Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkovMazdak Farrokhzad-290/+235
Implement RFC 2707 + Parser recovery for range patterns Implement https://github.com/rust-lang/rfcs/pull/2707. - Add a new basic syntactic pattern form `ast::PatKind::Rest` (parsed as `..` or `DOTDOT`) and simplify `ast::PatKind::{Slice, Tuple, TupleStruct}` as a result. - Lower `ast::PatKind::Rest` in combination with the aforementioned `PatKind` variants as well as `PatKind::Ident`. The HIR remains unchanged for now (may be advisable to make slight adjustments later). - Refactor `parser.rs` wrt. parsing sequences and lists of things in the process. - Add parser recovery for range patterns of form `X..`, `X..=`, `X...`, `..Y`, `..=Y`, and `...Y`. This should make it easy to actually support these patterns semantically later if we so desire. cc https://github.com/rust-lang/rust/issues/62254 r? @petrochenkov
2019-07-28Address comments in lowering + parsing.Mazdak Farrokhzad-4/+7
2019-07-28Recover on 'X..' / 'X..=' / 'X...' range patterns.Mazdak Farrokhzad-21/+43
2019-07-28Recover on '..X' / '..=X' / '...X' range patterns.Mazdak Farrokhzad-6/+46
2019-07-28Adjust parsing of Slice, Tuple, TupleStruct patterns.Mazdak Farrokhzad-127/+26
2019-07-28Cleanup using the new parse_*_seq methods.Mazdak Farrokhzad-96/+60
2019-07-28Add more parse_*_seq methods for code reuse.Mazdak Farrokhzad-0/+24
2019-07-28Cleanup parse_seq_* methods + record trailing separators.Mazdak Farrokhzad-42/+35
2019-07-28Rollup merge of #63038 - eupn:outer-attribute-diag, r=estebankMazdak Farrokhzad-16/+45
Make more informative error on outer attribute after inner Fixes #61218. ?r @estebank
2019-07-27Treat doc comments separatelyEvgenii P-8/+20
2019-07-27syntax_ext: `proc_macro_decls` -> `proc_macro_harness`Vadim Petrochenkov-1/+2
Few other minor renamings for consistency. Remove one unused dependency from `rustc_passes`. Fix libsyntax tests. Fix rebase.
2019-07-27Move standard library injection into libsyntax_extVadim Petrochenkov-1/+4
2019-07-27Lint attributes on function argumentsCaio-2/+8
2019-07-27Make more informative error on outer attr after innerEvgenii P-15/+32
2019-07-26Rollup merge of #62963 - estebank:homoglyph-recovery, r=petrochenkovMazdak Farrokhzad-35/+52
Allow lexer to recover from some homoglyphs
2019-07-25Rollup merge of #62887 - estebank:issue-62881, r=petrochenkovMazdak Farrokhzad-1/+14
Make the parser TokenStream more resilient after mismatched delimiter recovery Fix #62881, fix #62895.
2019-07-25review comments: add FIXME comments and formattingEsteban Küber-8/+21
2019-07-24Allow lexer to recover from some homoglyphsEsteban Küber-33/+37
2019-07-24Rollup merge of #62917 - estebank:trailing-slash, r=matkladMazdak Farrokhzad-1/+1
Always emit trailing slash error Fix #62913. r? @petrochenkov
2019-07-23Always emit trailing slash errorEsteban Küber-1/+1
2019-07-23review commentsEsteban Küber-3/+4
2019-07-23Fix another caseEsteban Küber-3/+12
2019-07-23Rollup merge of #62851 - matklad:unescape, r=petrochenkovMark Rousskov-609/+5
move unescape module to rustc_lexer It makes sense to keep the definition of escape sequences closer to the lexer itself, and it is also a bit of code that I would like to share with rust-analyzer. r? @petrochenkov
2019-07-23Rollup merge of #62791 - estebank:type-ascription, r=petrochenkovMark Rousskov-65/+73
Handle more cases of typos misinterpreted as type ascription Fix #60933, #54516. CC #47666, #34255, #48016.
2019-07-22Make the parser TokenStream more resilient after mismatched delimiter recoveryEsteban Küber-0/+3
2019-07-22Rollup merge of #62870 - matklad:issue-62863, r=petrochenkovMazdak Farrokhzad-1/+1
fix lexing of comments with many \r closes #62863
2019-07-22fix lexing of comments with many \rAleksey Kladov-1/+1
closes #62863
2019-07-21Fix typo in Unicode character nameAndrew Dassonville-1/+1
2019-07-21move unescape module to rustc_lexerAleksey Kladov-609/+5
2019-07-20Introduce rustc_lexerAleksey Kladov-1247/+531
The idea here is to make a reusable library out of the existing rust-lexer, by separating out pure lexing and rustc-specific concerns, like spans, error reporting an interning. So, rustc_lexer operates directly on `&str`, produces simple tokens which are a pair of type-tag and a bit of original text, and does not report errors, instead storing them as flags on the token.
2019-07-19review commentsEsteban Küber-16/+10
2019-07-19Handle more cases of typos misinterpreted as type ascriptionEsteban Küber-61/+75
2019-07-16Rollup merge of #62703 - ↵Mark Rousskov-3/+3
fakenine:normalize_use_of_backticks_compiler_messages_p6, r=eddyb normalize use of backticks in compiler messages for libsyntax/parse https://github.com/rust-lang/rust/issues/60532
2019-07-16Rollup merge of #62666 - estebank:preempt-ice, r=eddybMark Rousskov-8/+9
Cancel unemitted diagnostics during error recovery Follow up to https://github.com/rust-lang/rust/pull/62604. Use @eddyb's preferred style and catch other case of the same problem. r? @eddyb
2019-07-15Rollup merge of #62668 - goodmanjonathan:fix-62660, r=estebankMark Rousskov-1/+1
Fix #62660 If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE. Fixes #62660.
2019-07-16normalize use of backticks in compiler messages for libsyntax/parseSamy Kacimi-3/+3
https://github.com/rust-lang/rust/issues/60532
2019-07-15Auto merge of #62670 - estebank:extern-fn-with-body, r=petrochenkovbors-14/+61
Detect `fn` with a body in an `extern` block Fix #62109.