1
Fork 0
rust/compiler/rustc_parse/src/parser
Nicholas Nethercote e2aa38e6ab Rework pattern and expression nonterminal kinds.
Merge `PatParam`/`PatWithOr`, and `Expr`/`Expr2021`, for a few reasons.

- It's conceptually nice, because the two pattern kinds and the two
  expression kinds are very similar.

- With expressions in particular, there are several places where both
  expression kinds get the same treatment.

- It removes one unreachable match arm.

- Most importantly, for #124141 I will need to introduce a new type
  `MetaVarKind` that is very similar to `NonterminalKind`, but records a
  couple of extra fields for expression metavars. It's nicer to have a
  single `MetaVarKind::Expr` expression variant to hold those extra
  fields instead of duplicating them across two variants
  `MetaVarKind::{Expr,Expr2021}`. And then it makes sense for patterns
  to be treated the same way, and for `NonterminalKind` to also be
  treated the same way.

I also clarified the comments, because I have long found them a little
hard to understand.
2024-06-23 15:57:24 +10:00
..
mut_visit Specialize assert_pred. 2024-06-06 08:26:54 +10:00
tokenstream Move some tests from rustc_expand to rustc_parse. 2024-05-06 09:06:02 +10:00
attr.rs Fix build 2024-06-06 20:27:25 -05:00
attr_wrapper.rs Auto merge of #126678 - nnethercote:fix-duplicated-attrs-on-nt-expr, r=petrochenkov 2024-06-19 13:58:21 +00:00
diagnostics.rs Rollup merge of #126125 - dev-ardi:conflict-markers, r=estebank 2024-06-21 09:12:34 +02:00
expr.rs Add blank lines after module-level // comments. 2024-06-20 09:23:20 +10:00
generics.rs Rework precise capturing syntax 2024-06-17 22:35:25 -04:00
item.rs StaticForeignItem and StaticItem are the same 2024-06-20 19:51:09 -04:00
mod.rs Properly gate safe keyword in pre-expansion 2024-06-20 14:14:49 -04:00
nonterminal.rs Rework pattern and expression nonterminal kinds. 2024-06-23 15:57:24 +10:00
pat.rs Inline can_begin_literal_maybe_minus call into two places. 2024-06-20 04:50:38 +10:00
path.rs Refactor parse_expr_res. 2024-06-19 19:12:02 +10:00
stmt.rs Refactor parse_expr_res. 2024-06-19 19:12:02 +10:00
tests.rs Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
ty.rs Rework precise capturing syntax 2024-06-17 22:35:25 -04:00