From d4d986c7f850e1f535bb4c22e3a7f7fba5483628 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 15:46:12 +0200 Subject: Item is a Stmt --- xtask/src/codegen/gen_syntax.rs | 3 +++ xtask/src/codegen/rust.ungram | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'xtask/src/codegen') 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 fn extract_enum_traits(ast: &mut AstSrc) { for enm in &mut ast.enums { + if enm.name == "Stmt" { + continue; + } let nodes = &ast.nodes; let mut variant_traits = enm .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 = Stmt = LetStmt | ExprStmt +| Item LetStmt = Attr* 'let' Pat (':' Type)? @@ -316,7 +317,6 @@ Label = BlockExpr = Attr* Label '{' - Item* statements:Stmt* Expr? '}' -- cgit v1.2.3