diff options
Diffstat (limited to 'crates/libsyntax2')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 8 | ||||
-rw-r--r-- | crates/libsyntax2/src/grammar.ron | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index 6891e857c..f99d1274a 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs | |||
@@ -539,6 +539,14 @@ impl<'a> AstNode<'a> for ForExpr<'a> { | |||
539 | } | 539 | } |
540 | 540 | ||
541 | impl<'a> ForExpr<'a> { | 541 | impl<'a> ForExpr<'a> { |
542 | pub fn pat(self) -> Option<Pat<'a>> { | ||
543 | super::child_opt(self) | ||
544 | } | ||
545 | |||
546 | pub fn iterable(self) -> Option<Expr<'a>> { | ||
547 | super::child_opt(self) | ||
548 | } | ||
549 | |||
542 | pub fn body(self) -> Option<Block<'a>> { | 550 | pub fn body(self) -> Option<Block<'a>> { |
543 | super::child_opt(self) | 551 | super::child_opt(self) |
544 | } | 552 | } |
diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron index c9e128462..a98e9e2fd 100644 --- a/crates/libsyntax2/src/grammar.ron +++ b/crates/libsyntax2/src/grammar.ron | |||
@@ -344,7 +344,11 @@ Grammar( | |||
344 | options: [ ["body", "Block"] ] | 344 | options: [ ["body", "Block"] ] |
345 | ), | 345 | ), |
346 | "ForExpr": ( | 346 | "ForExpr": ( |
347 | options: [ ["body", "Block"] ] | 347 | options: [ |
348 | ["pat", "Pat"], | ||
349 | ["iterable", "Expr"], | ||
350 | ["body", "Block"] , | ||
351 | ] | ||
348 | ), | 352 | ), |
349 | "WhileExpr": ( | 353 | "WhileExpr": ( |
350 | options: [ | 354 | options: [ |