about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
AgeCommit message (Collapse)AuthorLines
2019-11-07move syntax::{parse::literal -> util::literal}Mazdak Farrokhzad-2/+1
2019-11-07move syntax::parse::lexer::comments -> syntax::util::commentsMazdak Farrokhzad-2/+2
2019-11-07syntax::attr: remove usage of lexerMazdak Farrokhzad-2/+9
2019-11-07move parse::classify -> util::classifyMazdak Farrokhzad-2/+3
2019-11-07move PResult to librustc_errorsMazdak Farrokhzad-22/+26
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-10/+10
2019-11-07syntax: simplify importsMazdak Farrokhzad-1/+1
2019-11-07move parse/parser.rs -> parse/parser/mod.rsMazdak Farrokhzad-0/+1391
2019-11-07Rollup merge of #65974 - Centril:matcher-friendly-gating, r=petrochenkovMazdak Farrokhzad-29/+23
A scheme for more macro-matcher friendly pre-expansion gating Pre-expansion gating will now avoid gating macro matchers that did not result in `Success(...)`. That is, the following is now OK despite `box 42` being a valid `expr` and that form being pre-expansion gated: ```rust macro_rules! m { ($e:expr) => { 0 }; // This fails on the input below due to `, foo`. (box $e:expr, foo) => { 1 }; // Successful matcher, we should get `2`. } fn main() { assert_eq!(1, m!(box 42, foo)); } ``` Closes https://github.com/rust-lang/rust/issues/65846. r? @petrochenkov cc @Mark-Simulacrum
2019-11-07parser: allow ABIs from literal macro fragmentsMazdak Farrokhzad-2/+6
2019-11-07parser: don't hardcode ABIs into grammarMazdak Farrokhzad-12/+9
2019-11-06Make doc comments cheaper with `AttrKind`.Nicholas Nethercote-9/+10
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a big performance win (over 10% in some cases) because `DocComment` lets doc comments (which are common) be represented very cheaply. `Attribute` gets some new helper methods to ease the transition: - `has_name()`: check if the attribute name matches a single `Symbol`; for `DocComment` variants it succeeds if the symbol is `sym::doc`. - `is_doc_comment()`: check if it has a `DocComment` kind. - `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant; panic otherwise. Fixes #60935.
2019-11-06revamp pre-expansion gating infraMazdak Farrokhzad-29/+23
2019-11-06Rollup merge of #66139 - euclio:pluralize, r=nagisaMazdak Farrokhzad-8/+8
use American spelling for `pluralize!`
2019-11-06Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, ↵Mazdak Farrokhzad-5/+5
r=estebank Rename `LocalInternedString` and more This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses. r? @estebank
2019-11-06Rollup merge of #66098 - estebank:path-asciption-typo, r=CentrilMazdak Farrokhzad-4/+12
Detect `::` -> `:` typo when involving turbofish Fix #65569.
2019-11-05use American spelling for `pluralize!`Andy Russell-8/+8
2019-11-05Account for typo in turbofish and suggest `::`Esteban Küber-4/+10
2019-11-04Detect `::` -> `:` typo when involving turbofishEsteban Küber-1/+3
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-11-02Remove the `AsRef` impl for `SymbolStr`.Nicholas Nethercote-4/+4
Because it's highly magical, which goes against the goal of keeping `SymbolStr` simple. Plus it's only used in a handful of places that only require minor changes.
2019-11-02Simplify various `Symbol` use points.Nicholas Nethercote-1/+1
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch of unnecessary sigils.
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