| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2020-02-29 | Rename `syntax` to `rustc_ast` in source code | Vadim Petrochenkov | -9/+13 | |
| 2020-02-29 | rustc_parse: Tweak the function parameter name check | Vadim Petrochenkov | -3/+4 | |
| 2020-02-29 | parser: Remove `Parser::prev_span` | Vadim Petrochenkov | -1/+1 | |
| 2020-02-29 | parser: `prev_span` -> `prev_token.span` | Vadim Petrochenkov | -28/+31 | |
| 2020-02-28 | Rollup merge of #69384 - petrochenkov:nounnorm, r=Centril | Mazdak Farrokhzad | -8/+6 | |
| parser: `token` -> `normalized_token`, `nonnormalized_token` -> `token` So, after https://github.com/rust-lang/rust/pull/69006, its follow-ups and an attempt to remove `Parser::prev_span` I came to the conclusion that the unnormalized token and its span is what you want in most cases, so it should be default. Normalization only makes difference in few cases where we are checking against `token::Ident` or `token::Lifetime` specifically. This PR uses `normalized_token` for those cases. Using normalization explicitly means that people writing code should remember about `NtIdent` and `NtLifetime` in general. (That is alleviated by the fact that `token.ident()` and `fn parse_ident_*` are already written.) Remembering about `NtIdent`, was, however, already the case, kind of, because the implicit normalization was performed only for the current/previous token, but not for things like `look_ahead`. As a result, most of token classification methods in `token.rs` already take `NtIdent` into account (this PR fixes a few pre-existing minor mistakes though). The next step is removing `normalized(_prev)_token` entirely and replacing it with `token.ident()` (mostly) and `token.normalize()` (occasionally). I want to make it a separate PR for that and run it though perf. `normalized_token` filled on every bump has both a potential to avoid repeated normalization, and to do unnecessary work in advance (it probably doesn't matter anyway, the normalization is very cheap). r? @Centril | ||||
| 2020-02-26 | Rollup merge of #69423 - petrochenkov:nont, r=Centril | Dylan DPC | -8/+0 | |
| syntax: Remove `Nt(Impl,Trait,Foreign)Item` Follow-up to https://github.com/rust-lang/rust/pull/69366. r? @Centril | ||||
| 2020-02-24 | syntax: Remove `Nt(Impl,Trait,Foreign)Item` | Vadim Petrochenkov | -8/+0 | |
| 2020-02-24 | don't explicitly compare against true or false | Matthias Krüger | -2/+2 | |
| 2020-02-24 | parser: `token` -> `normalized_token`, `nonnormalized_token` -> `token` | Vadim Petrochenkov | -8/+6 | |
| 2020-02-24 | parse: tweak diagnostic wordings | Mazdak Farrokhzad | -5/+5 | |
| 2020-02-24 | parse: tweak `parse_item_` for more reuse. | Mazdak Farrokhzad | -17/+7 | |
| 2020-02-24 | parse/ast: move `Defaultness` into variants. | Mazdak Farrokhzad | -32/+32 | |
| 2020-02-24 | parse: `NtItem` -> `parse_item_common`. | Mazdak Farrokhzad | -8/+9 | |
| 2020-02-24 | parser: tweak item kind wording | Mazdak Farrokhzad | -11/+9 | |
| 2020-02-24 | parser: tweak unmatched wording | Mazdak Farrokhzad | -5/+6 | |
| 2020-02-24 | parser: refactor away at_end | Mazdak Farrokhzad | -9/+3 | |
| 2020-02-24 | parse: move token hack into `parse_item_common`. | Mazdak Farrokhzad | -55/+31 | |
| 2020-02-24 | parse: use `parse_item_common` in `parse_assoc_item_`. | Mazdak Farrokhzad | -144/+72 | |
| 2020-02-24 | parse: use `parse_item_common` in `parse_foreign_item`. | Mazdak Farrokhzad | -28/+53 | |
| 2020-02-24 | parse: recover `default` on free items. | Mazdak Farrokhzad | -13/+46 | |
| 2020-02-24 | parse: extract `error_on_unmatched_vis`. | Mazdak Farrokhzad | -10/+16 | |
| 2020-02-24 | ast: add `Defaultness` to `Item`, making `AssocItem` an alias. | Mazdak Farrokhzad | -3/+4 | |
| 2020-02-24 | `parse_defaultness`: avoid hardcoded list of keywords. | Mazdak Farrokhzad | -26/+13 | |
| 2020-02-24 | add `Span` to `ast::Defaultness::Default`. | Mazdak Farrokhzad | -1/+1 | |
| 2020-02-22 | parse: allow `type Foo: Ord` syntactically. | Mazdak Farrokhzad | -20/+12 | |
| 2020-02-18 | Rollup merge of #69211 - petrochenkov:prevtok, r=Centril | Mazdak Farrokhzad | -3/+4 | |
| parser: Simplify treatment of macro variables in `Parser::bump` Follow-up to https://github.com/rust-lang/rust/pull/69006. Token normalization for `$ident` and `$lifetime` is merged directly into `bump`. Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling (as a result `bump` also doesn't call itself recursively anymore and can't make `prev_token` inconsistent). r? @Centril | ||||
| 2020-02-18 | Rollup merge of #69194 - Centril:assoc-extern-fuse, r=petrochenkov | Mazdak Farrokhzad | -117/+91 | |
| parse: fuse associated and extern items up to defaultness Language changes: - The grammar of extern `type` aliases is unified with associated ones, and becomes: ```rust TypeItem = "type" ident generics {":" bounds}? where_clause {"=" type}? ";" ; ``` Semantic restrictions (`ast_validation`) are added to forbid any parameters in `generics`, any bounds in `bounds`, and any predicates in `where_clause`, as well as the presence of a type expression (`= u8`). (Work still remains to fuse this with free `type` aliases, but this can be done later.) - The grammar of constants and static items (free, associated, and extern) now permits the absence of an expression, and becomes: ```rust GlobalItem = {"const" {ident | "_"} | "static" "mut"? ident} {"=" expr}? ";" ; ``` - A semantic restriction is added to enforce the presence of the expression (the body). - A semantic restriction is added to reject `const _` in associated contexts. Together, these changes allow us to fuse the grammar of associated items and extern items up to `default`ness which is the main goal of the PR. ----------------------- We are now very close to fully fusing the entirely of item parsing and their ASTs. To progress further, we must make a decision: should we parse e.g. `default use foo::bar;` and whatnot? Accepting that is likely easiest from a parsing perspective, as it does not require using look-ahead, but it is perhaps not too onerous to only accept it for `fn`s (and all their various qualifiers), `const`s, `static`s, and `type`s. r? @petrochenkov | ||||
| 2020-02-17 | parser: Set previous and unnormalized tokens in couple more places | Vadim Petrochenkov | -3/+4 | |
| 2020-02-15 | reject assoc statics & extern consts during parsing | Mazdak Farrokhzad | -1/+26 | |
| 2020-02-15 | fuse extern & associated item parsing up to defaultness | Mazdak Farrokhzad | -77/+39 | |
| 2020-02-15 | parse extern consts | Mazdak Farrokhzad | -21/+6 | |
| 2020-02-15 | parse associated statics. | Mazdak Farrokhzad | -10/+8 | |
| 2020-02-15 | ast/parser: fuse `static` & `const` grammars in all contexts. | Mazdak Farrokhzad | -16/+21 | |
| 2020-02-15 | ast: make `= <expr>;` optional in free statics/consts. | Mazdak Farrokhzad | -11/+8 | |
| 2020-02-15 | ast: normalize `ForeignItemKind::Ty` & `AssocItemKind::TyAlias`. | Mazdak Farrokhzad | -5/+7 | |
| 2020-02-15 | ast: move Generics into AssocItemKinds | Mazdak Farrokhzad | -8/+8 | |
| 2020-02-15 | parser: `macro_rules` is a weak keyword | Vadim Petrochenkov | -2/+2 | |
| 2020-02-13 | parser: inline parse_assoc_macro_invoc | Mazdak Farrokhzad | -20/+10 | |
| 2020-02-13 | parser: misc small item related improvements & cleanups. | Mazdak Farrokhzad | -138/+120 | |
| 2020-02-13 | parser: extract `recover_const_mut`. | Mazdak Farrokhzad | -13/+17 | |
| 2020-02-13 | parser: fuse `trait` parsing & layer with `is_path_start_item` | Mazdak Farrokhzad | -20/+26 | |
| 2020-02-13 | parser: make `eat_macro_def` redundant. | Mazdak Farrokhzad | -26/+9 | |
| 2020-02-13 | parser: remove `Option<Vec<Attribute>>` in `ItemInfo`. | Mazdak Farrokhzad | -58/+49 | |
| 2020-02-13 | parser_item_mod: avoid cloning outer attributes | Mazdak Farrokhzad | -1/+1 | |
| 2020-02-13 | parser: introduce `parse_item_kind` as central `ItemInfo` logic. | Mazdak Farrokhzad | -192/+156 | |
| this also extracts macro item parsers. | ||||
| 2020-02-13 | parser: extract `recover_missing_kw_before_item` | Mazdak Farrokhzad | -84/+90 | |
| 2020-02-13 | parser: unify item list parsing. | Mazdak Farrokhzad | -56/+46 | |
| as a consequence, `trait X { #![attr] }` becomes legal. | ||||
| 2020-02-13 | parser: extract common foreign item code for each kind | Mazdak Farrokhzad | -67/+21 | |
| 2020-02-13 | parser: is_fn_front_matter -> check_fn_front_matter | Mazdak Farrokhzad | -4/+4 | |
| 2020-02-13 | parser: simplify ParamCfg -> ReqName | Mazdak Farrokhzad | -27/+17 | |
