diff options
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 12 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index c2e89de15..0376c91c8 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -513,7 +513,11 @@ impl ast::TypeParamsOwner for ConstDef {} | |||
513 | impl ast::AttrsOwner for ConstDef {} | 513 | impl ast::AttrsOwner for ConstDef {} |
514 | impl ast::DocCommentsOwner for ConstDef {} | 514 | impl ast::DocCommentsOwner for ConstDef {} |
515 | impl ast::TypeAscriptionOwner for ConstDef {} | 515 | impl ast::TypeAscriptionOwner for ConstDef {} |
516 | impl ConstDef {} | 516 | impl ConstDef { |
517 | pub fn body(&self) -> Option<&Expr> { | ||
518 | super::child_opt(self) | ||
519 | } | ||
520 | } | ||
517 | 521 | ||
518 | // ContinueExpr | 522 | // ContinueExpr |
519 | #[derive(Debug, PartialEq, Eq, Hash)] | 523 | #[derive(Debug, PartialEq, Eq, Hash)] |
@@ -3364,7 +3368,11 @@ impl ast::TypeParamsOwner for StaticDef {} | |||
3364 | impl ast::AttrsOwner for StaticDef {} | 3368 | impl ast::AttrsOwner for StaticDef {} |
3365 | impl ast::DocCommentsOwner for StaticDef {} | 3369 | impl ast::DocCommentsOwner for StaticDef {} |
3366 | impl ast::TypeAscriptionOwner for StaticDef {} | 3370 | impl ast::TypeAscriptionOwner for StaticDef {} |
3367 | impl StaticDef {} | 3371 | impl StaticDef { |
3372 | pub fn body(&self) -> Option<&Expr> { | ||
3373 | super::child_opt(self) | ||
3374 | } | ||
3375 | } | ||
3368 | 3376 | ||
3369 | // Stmt | 3377 | // Stmt |
3370 | #[derive(Debug, PartialEq, Eq, Hash)] | 3378 | #[derive(Debug, PartialEq, Eq, Hash)] |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index dc0de5808..0a35e25d5 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -315,6 +315,7 @@ Grammar( | |||
315 | "DocCommentsOwner", | 315 | "DocCommentsOwner", |
316 | "TypeAscriptionOwner", | 316 | "TypeAscriptionOwner", |
317 | ], | 317 | ], |
318 | options: [ ["body","Expr"]], | ||
318 | ), | 319 | ), |
319 | "StaticDef": ( | 320 | "StaticDef": ( |
320 | traits: [ | 321 | traits: [ |
@@ -325,6 +326,7 @@ Grammar( | |||
325 | "DocCommentsOwner", | 326 | "DocCommentsOwner", |
326 | "TypeAscriptionOwner", | 327 | "TypeAscriptionOwner", |
327 | ], | 328 | ], |
329 | options: [ ["body","Expr"]], | ||
328 | ), | 330 | ), |
329 | "TypeAliasDef": ( | 331 | "TypeAliasDef": ( |
330 | traits: [ | 332 | traits: [ |