diff options
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 3 | ||||
-rw-r--r-- | xtask/src/codegen/rust.ungram | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index e3d4269f6..d9f358513 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -694,6 +694,9 @@ fn extract_struct_trait(node: &mut AstNodeSrc, trait_name: &str, methods: &[&str | |||
694 | 694 | ||
695 | fn extract_enum_traits(ast: &mut AstSrc) { | 695 | fn extract_enum_traits(ast: &mut AstSrc) { |
696 | for enm in &mut ast.enums { | 696 | for enm in &mut ast.enums { |
697 | if enm.name == "Stmt" { | ||
698 | continue; | ||
699 | } | ||
697 | let nodes = &ast.nodes; | 700 | let nodes = &ast.nodes; |
698 | let mut variant_traits = enm | 701 | let mut variant_traits = enm |
699 | .variants | 702 | .variants |
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 8271509cf..17de36d7a 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram | |||
@@ -197,6 +197,7 @@ Attr = | |||
197 | Stmt = | 197 | Stmt = |
198 | LetStmt | 198 | LetStmt |
199 | | ExprStmt | 199 | | ExprStmt |
200 | | Item | ||
200 | 201 | ||
201 | LetStmt = | 202 | LetStmt = |
202 | Attr* 'let' Pat (':' Type)? | 203 | Attr* 'let' Pat (':' Type)? |
@@ -316,7 +317,6 @@ Label = | |||
316 | BlockExpr = | 317 | BlockExpr = |
317 | Attr* Label | 318 | Attr* Label |
318 | '{' | 319 | '{' |
319 | Item* | ||
320 | statements:Stmt* | 320 | statements:Stmt* |
321 | Expr? | 321 | Expr? |
322 | '}' | 322 | '}' |