about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2019-08-28Auto merge of #63127 - kper:pr, r=nikomatsakisbors-48/+50
Cleanup: Consistently use `Param` instead of `Arg` #62426 Fixes #62426
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-48/+50
2019-08-27Rollup merge of #63761 - petrochenkov:procattrs, r=eddybMazdak Farrokhzad-4/+5
Propagate spans and attributes from proc macro definitions Thanks to https://github.com/rust-lang/rust/pull/63269 we now have spans and attributes from proc macro definitions available in metadata. However, that PR didn't actually put them into use! This PR finishes that work. Attributes `rustc_macro_transparency`, `allow_internal_unstable`, `allow_internal_unsafe`, `local_inner_macros`, `rustc_builtin_macro`, `stable`, `unstable`, `rustc_deprecated`, `deprecated` now have effect when applied to proc macro definition functions. From those attributes only `deprecated` is both stable and supposed to be used in new code. (`#![staged_api]` still cannot be used in proc macro crates for unrelated reasons though.) `Span::def_site` from the proc macro API now returns the correct location of the proc macro definition. Also, I made a mistake in https://github.com/rust-lang/rust/pull/63269#discussion_r312702919, loaded proc macros didn't actually use the resolver cache. This PR fixes the caching issue, now proc macros go through the `Resolver::macro_map` cache as well. (Also, the first commit turns `proc_macro::quote` into a regular built-in macro to reduce the number of places where `SyntaxExtension`s need to be manually created.)
2019-08-27proc_macro: Update `Span::def_site` to use the proc macro definition locationVadim Petrochenkov-4/+5
Which is no longer dummy and is available from metadata now.
2019-08-25parser: gracefully handle `fn foo(A | B: type)`.Mazdak Farrokhzad-1/+1
2019-08-24parser: drive-by: simplify `parse_arg_general`.Mazdak Farrokhzad-6/+3
2019-08-15hygiene: Remove `Option`s from functions returning `ExpnInfo`Vadim Petrochenkov-1/+0
The expansion info is not optional and should always exist
2019-08-15syntax_pos: Introduce a helper for checking whether a span comes from expansionVadim Petrochenkov-1/+1
2019-08-12syntax: account for CVarArgs being in the argument list.Eduard-Mihai Burtescu-1/+1
2019-08-11parser: {check,expect}_lifetime into ty.rsMazdak Farrokhzad-17/+1
2019-08-11parser: move into generics.rsMazdak Farrokhzad-270/+2
2019-08-11parser: move into stmt.rsMazdak Farrokhzad-458/+9
2019-08-11parser: move parse_fn_block_decl into expr.rsMazdak Farrokhzad-51/+1
2019-08-11parser: move parse_ident_or_underscore into item.rsMazdak Farrokhzad-11/+0
2019-08-11parser: split into {ty, path}.rsMazdak Farrokhzad-899/+9
2019-08-11parser: split into {item,module}.rsMazdak Farrokhzad-2218/+20
2019-08-11parser: split into pat.rsMazdak Farrokhzad-633/+8
2019-08-11parser: split into expr.rsMazdak Farrokhzad-1667/+9
2019-08-09Recover parser from `foo(_, _)`Esteban Küber-20/+50
2019-08-04Auto merge of #63213 - varkor:itemkind-tyalias, r=Centrilbors-2/+2
Rename `ItemKind::Ty` to `ItemKind::TyAlias` The current name is not entirely clear without context and `TyAlias` is consistent with `ItemKind::TraitAlias`.
2019-08-04Rename `ItemImplKind::Type` to `ItemImplKind::TyAlias`varkor-1/+1
2019-08-04Rename `ItemKind::Ty` to `ItemKind::TyAlias`varkor-1/+1
2019-08-04Auto merge of #62816 - estebank:type-ascription-macros, r=petrochenkovbors-6/+36
Point at type ascription before macro invocation on expansion parse error Fix https://github.com/rust-lang/rust/issues/47666. Follow up to https://github.com/rust-lang/rust/pull/62791. r? @petrochenkov
2019-08-03Rollup merge of #63146 - Mark-Simulacrum:clean-attr, r=petrochenkovMazdak Farrokhzad-9/+2
Cleanup syntax::attr Mostly removing needless arguments to constructors r? @petrochenkov
2019-08-03Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centrilbors-30/+13
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063. r? @Centril
2019-08-02Rollup merge of #63202 - exphp-forks:parser-ice-63135, r=estebankMazdak Farrokhzad-1/+9
Fix ICE in #63135 Closes #63135. r?@estebank
2019-08-02Replace "existential" by "opaque"varkor-12/+6
2019-08-02Switch existential_type to type_alias_impl_traitvarkor-18/+7
2019-08-01Fix ICE in #63135Michael Lamparski-1/+9
2019-08-01Rollup merge of #63122 - Centril:fix-63115, r=petrochenkovPietro Albini-6/+3
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-6/+2
2019-07-31Replace a few Attribute constructors with mk_attrMark Rousskov-9/+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-35/+11
2019-07-30Rollup merge of #62928 - Centril:recover-parens-around-for-head, r=estebankMazdak Farrokhzad-125/+136
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/+1
2019-07-28Rollup merge of #61856 - c410-f3r:attrs-fn, r=matthewjasperMazdak Farrokhzad-1/+7
Lint attributes on function arguments Fixes #61238. cc #60406
2019-07-28Add 'span_to_snippet' shortcut.Mazdak Farrokhzad-10/+7
2019-07-28Use chaining for diagnosics in parser.Mazdak Farrokhzad-119/+122
2019-07-28Recover 'for ( $pat in $expr ) $block'.Mazdak Farrokhzad-0/+11
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-27Lint attributes on function argumentsCaio-1/+7
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-23review commentsEsteban Küber-3/+4