about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2019-08-28Auto merge of #63127 - kper:pr, r=nikomatsakisbors-78/+80
Cleanup: Consistently use `Param` instead of `Arg` #62426 Fixes #62426
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-78/+80
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-26parser: fix span for leading vert.Mazdak Farrokhzad-1/+2
2019-08-25parser: TopLevel -> RecoverComma.Mazdak Farrokhzad-10/+10
2019-08-25parser: gracefully handle `fn foo(A | B: type)`.Mazdak Farrokhzad-11/+41
2019-08-25parser: 'while parsing this or-pattern...'Mazdak Farrokhzad-1/+4
2019-08-25parser: simplify parse_pat_with_or_{inner}Mazdak Farrokhzad-17/+10
2019-08-24parser: reword || recovery.Mazdak Farrokhzad-1/+1
2019-08-24parser: extract recover_inner_leading_vert.Mazdak Farrokhzad-4/+7
2019-08-24parse_top_pat: silence leading vert gating sometimes.Mazdak Farrokhzad-3/+15
2019-08-24parser: bool -> TopLevel.Mazdak Farrokhzad-5/+9
2019-08-24parser: bool -> GateOr.Mazdak Farrokhzad-10/+16
2019-08-24parser: better recovery for || in inner pats.Mazdak Farrokhzad-4/+23
2019-08-24parser: drive-by: simplify `parse_arg_general`.Mazdak Farrokhzad-6/+3
2019-08-24parser: `let` stmts & `for` exprs: allow or-patterns.Mazdak Farrokhzad-8/+2
2019-08-24parser: document `parse_pat`.Mazdak Farrokhzad-0/+4
2019-08-24parser: `parse_pats` -> `parse_top_pat{_unpack}`.Mazdak Farrokhzad-16/+24
2019-08-24parser: document `ban_unexpected_or_or`.Mazdak Farrokhzad-0/+1
2019-08-24parser: move `maybe_recover_unexpected_comma` to a more appropriate place.Mazdak Farrokhzad-50/+49
2019-08-24parser: use `eat_or_separator` for leading vert.Mazdak Farrokhzad-2/+2
2019-08-24parser: improve `parse_pat_with_or` docs.Mazdak Farrokhzad-1/+2
2019-08-24parser: extract `eat_or_separator`.Mazdak Farrokhzad-30/+28
2019-08-24parser: integrate `maybe_recover_unexpected_comma` in `parse_pat_with_or`.Mazdak Farrokhzad-9/+17
2019-08-24parser: extract `maybe_recover_unexpected_comma`.Mazdak Farrokhzad-31/+36
2019-08-24parser: simplify `parse_pat_with_or`.Mazdak Farrokhzad-1/+1
2019-08-24parser: improve or-patterns recovery.Mazdak Farrokhzad-4/+11
2019-08-24parser: refactor `parse_pat_with_or` + use it in [p0, p1, ..] pats.Mazdak Farrokhzad-8/+15
2019-08-24parser: type alias `type Expected = Option<&'static str>;`.Mazdak Farrokhzad-8/+7
2019-08-24parser: extract `ban_unexpected_or_or`.Mazdak Farrokhzad-11/+13
2019-08-21Rollup merge of #63759 - Centril:parse-default-async-fn, r=petrochenkovMazdak Farrokhzad-0/+1
Allow 'default async fn' to parse. - Parse default async fn. Fixes #63716. (`cherry-pick`ed from 3rd commit in https://github.com/rust-lang/rust/pull/63749.) r? @petrochenkov
2019-08-20Allow 'default async fn' to parse.Mazdak Farrokhzad-0/+1
2019-08-20Use dedicated type for spans in pre-expansion gating.Mazdak Farrokhzad-22/+25
2019-08-19glue tokens when building token streamAleksey Kladov-9/+33
2019-08-19remove composite tokens support from the lexerAleksey Kladov-37/+20
2019-08-18Auto merge of #62948 - matklad:failable-file-loading, r=petrochenkovbors-66/+15
Normalize newlines when loading files Fixes #62865
2019-08-17initial implementation of or-pattern parsingDan Robertson-4/+40
Initial implementation of parsing or-patterns e.g., `Some(Foo | Bar)`. This is a partial implementation of RFC 2535.
2019-08-16Feature gate 'yield ?' pre-expansion.Mazdak Farrokhzad-0/+6
2019-08-15hygiene: `ExpnInfo` -> `ExpnData`Vadim Petrochenkov-1/+1
For naming consistency with everything else in this area
2019-08-15syntax_pos: Remove the duplicate global editionVadim Petrochenkov-29/+6
It was introduced to avoid going through `hygiene_data`, but now it's read only once, when `ParseSess` is created, so going through a lock is ok.
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-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-1/+1
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
2019-08-15syntax_pos: `NO_EXPANSION`/`SyntaxContext::empty()` -> `SyntaxContext::root()`Vadim Petrochenkov-11/+10
For consistency with `ExpnId::root`. Also introduce a helper `Span::with_root_ctxt` for creating spans with `SyntaxContext::root()` context
2019-08-15syntax_pos: Introduce a helper for checking whether a span comes from expansionVadim Petrochenkov-1/+1
2019-08-15Remove `Spanned` from `{ast,hir}::FieldPat`Vadim Petrochenkov-14/+8
2019-08-15Remove `Spanned` from `ast::Mac`Vadim Petrochenkov-20/+26
2019-08-15Remove `Spanned` from `mk_name_value_item_str` and `expr_to_spanned_string`Vadim Petrochenkov-2/+2
2019-08-14Rollup merge of #63543 - c410-f3r:variant, r=c410-f3rMazdak Farrokhzad-8/+8
Merge Variant and Variant_ Extracted from #63468.
2019-08-14Rollup merge of #63542 - c410-f3r:node_ids, r=petrochenkovMazdak Farrokhzad-0/+4
Add NodeId for Arm, Field and FieldPat Extracted from #63468