about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
AgeCommit message (Collapse)AuthorLines
2019-11-04Auto merge of #65838 - estebank:resilient-recovery, r=Centrilbors-15/+52
Reduce amount of errors given unclosed delimiter When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it on a more granular way in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace. Fix #63690.
2019-10-31Create new error E0743Guillaume Gomez-2/+5
2019-10-30Do not complain about missing `fn main()` in some casesEsteban Küber-0/+5
2019-10-30Reduce ammount of errors given unclosed delimiterEsteban Küber-15/+47
When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it more granularly in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace.
2019-10-28review commentsEsteban Küber-42/+39
2019-10-28Tweak unexpected token wordingEsteban Küber-5/+5
2019-10-28Use heuristics to recover parsing of missing `;`Esteban Küber-51/+70
- Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon.
2019-10-28Rollup merge of #65792 - Centril:split-syntax-2, r=petrochenkovMazdak Farrokhzad-1/+1
rustc, rustc_passes: reduce deps on rustc_expand Part of #65324. r? @petrochenkov
2019-10-27syntax/attr: reduce reliance on parserMazdak Farrokhzad-1/+1
2019-10-26review comments and tweaksEsteban Küber-1/+1
2019-10-25Rollup merge of #65790 - Centril:move-report-invalid, r=davidtwcoMazdak Farrokhzad-0/+20
move report_invalid_macro_expansion_item to item.rs From https://github.com/rust-lang/rust/pull/65324. r? @Mark-Simulacrum
2019-10-25move report_invalid_macro_expansion_item to item.rsMazdak Farrokhzad-0/+20
2019-10-24pre-expansion gate type_ascriptionMazdak Farrokhzad-0/+1
2019-10-24pre-expansion gate box_syntaxMazdak Farrokhzad-1/+3
2019-10-24pre-expansion gate label_break_valueMazdak Farrokhzad-0/+4
2019-10-24pre-expansion gate try_blocksMazdak Farrokhzad-1/+3
2019-10-24pre-expansion gate exclusive_range_patternMazdak Farrokhzad-2/+7
2019-10-24pre-expansion gate box_patternsMazdak Farrokhzad-1/+3
2019-10-24pre-expansion gate decl_macroMazdak Farrokhzad-0/+5
2019-10-24pre-expansion gate const_genericsMazdak Farrokhzad-0/+4
2019-10-24pre-expansion gate associated_type_boundsMazdak Farrokhzad-2/+10
2019-10-24pre-expansion gate trait_alias.Mazdak Farrokhzad-0/+2
2019-10-24syntax: reject `trait Foo: Bar = Baz;`.Mazdak Farrokhzad-8/+20
Add test for rejecting `trait A: B1 = B2;`. Also test rejection of `trait A: = B;`.
2019-10-23Rollup merge of #65686 - yjhmelody:yjhmelody-patch-1, r=CentrilYuki Okushi-2/+8
refactor and move `maybe_append`
2019-10-22refactor maybe_appendyjhmelody-2/+8
2019-10-18Rollup merge of #65552 - JohnTitor:use-bitwise-not, r=Dylan-DPCTyler Mandry-1/+1
Clarify diagnostics when using `~` as a unary op It seems we prefer `bitwise not` to `bitwise negation`. Fixes #57239 r? @estebank
2019-10-18Clarify diagnostics when using `~` as a unary opYuki Okushi-1/+1
2019-10-18Change `Lit::tokens()` to `Lit::token_tree()`.Nicholas Nethercote-5/+4
Because most of the call sites have an easier time working with a `TokenTree` instead of a `TokenStream`.
2019-10-16ui-fulldeps: make them pass again?Mazdak Farrokhzad-2/+2
2019-10-16make tidy happyMazdak Farrokhzad-3/+13
2019-10-16parser: leave a FIXME for laterMazdak Farrokhzad-0/+2
2019-10-16move SeqSep to parser.rsMazdak Farrokhzad-4/+5
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-15/+15
2019-10-16syntax::parse: don't depend on syntax::extMazdak Farrokhzad-6/+12
2019-10-16syntax: reduce visibilitiesMazdak Farrokhzad-65/+67
2019-10-16move diagnostics.rs into parser/Mazdak Farrokhzad-4/+1488
2019-10-16syntax: extract parse_cfg_attrMazdak Farrokhzad-0/+21
2019-10-16syntax: extract parse_derive_pathsMazdak Farrokhzad-1/+16
2019-10-16move parse::attr -> parse::parser::attrMazdak Farrokhzad-0/+330
2019-10-15move parse_lit to expr.rsMazdak Farrokhzad-6/+166
2019-10-14Rollup merge of #65410 - Centril:intersection-pat-recover, r=davidtwco,varkorTyler Mandry-0/+60
syntax: add parser recovery for intersection- / and-patterns `p1 @ p2` Fixes https://github.com/rust-lang/rust/issues/65400. The recovery comes in two flavors: 1. We know that `p2` is a binding so we can invert as `p2 @ p1`: ```rust error: pattern on wrong side of `@` --> $DIR/intersection-patterns.rs:13:9 | LL | Some(x) @ y => {} | -------^^^- | | | | | binding on the right, should be to the left | pattern on the left, should be to the right | help: switch the order: `y @ Some(x)` ``` 2. Otherwise we emit a generic diagnostic for the lack of support for intersection patterns: ```rust error: left-hand side of `@` must be a binding --> $DIR/intersection-patterns.rs:23:9 | LL | Some(x) @ Some(y) => {} | -------^^^------- | | | | | also a pattern | interpreted as a pattern, not a binding | = note: bindings are `x`, `mut x`, `ref x`, and `ref mut x` ``` For more on and-patterns, see e.g. https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching#and-pattern. r? @davidtwco cc @varkor @lzutao
2019-10-14recover_intersection_pat: adjust wordingMazdak Farrokhzad-3/+3
2019-10-14syntax: use `PatKind::Wild` as our `::Err` equivalent.Mazdak Farrokhzad-10/+10
2019-10-14syntax: add recovery for intersection patterns `p1 @ p2`Mazdak Farrokhzad-0/+60
2019-10-14Rollup merge of #65363 - Centril:less-pprust, r=Mark-SimulacrumMazdak Farrokhzad-2/+5
Remove implicit dependencies on syntax::pprust Part of https://github.com/rust-lang/rust/pull/65324. The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer. r? @estebank
2019-10-13syntax: consolidate function parsing in `item.rs`Mazdak Farrokhzad-206/+487
2019-10-13ast: remove implicit pprust dependency via Display.Mazdak Farrokhzad-2/+5
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
2019-10-07syntax: refactor with new `fn parse_use_tree_glob_or_nested`.Mazdak Farrokhzad-10/+11
2019-10-07syntax: use `parse_extern_abi` more.Mazdak Farrokhzad-8/+1
2019-10-07syntax: unify and simplify fn signature parsing.Mazdak Farrokhzad-33/+36