aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-09-02 19:23:19 +0100
committerAleksey Kladov <[email protected]>2019-09-02 19:23:19 +0100
commit5e3f291195b580580be7ce5622f54ebca75fb9f0 (patch)
tree772693eb44bde1fac1b9292456e1fa6e056bdb1f /crates/ra_syntax/src
parentdcf8e895038a7677711b8168ee12e1d47f6018bc (diff)
fix hir for new block syntax
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/ast/expr_extensions.rs6
-rw-r--r--crates/ra_syntax/src/ast/generated.rs2
-rw-r--r--crates/ra_syntax/src/ast/traits.rs2
-rw-r--r--crates/ra_syntax/src/grammar.ron2
4 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs
index d7ea4354d..1324965cf 100644
--- a/crates/ra_syntax/src/ast/expr_extensions.rs
+++ b/crates/ra_syntax/src/ast/expr_extensions.rs
@@ -9,12 +9,12 @@ use crate::{
9 9
10#[derive(Debug, Clone, PartialEq, Eq)] 10#[derive(Debug, Clone, PartialEq, Eq)]
11pub enum ElseBranch { 11pub enum ElseBranch {
12 Block(ast::Block), 12 Block(ast::BlockExpr),
13 IfExpr(ast::IfExpr), 13 IfExpr(ast::IfExpr),
14} 14}
15 15
16impl ast::IfExpr { 16impl ast::IfExpr {
17 pub fn then_branch(&self) -> Option<ast::Block> { 17 pub fn then_branch(&self) -> Option<ast::BlockExpr> {
18 self.blocks().nth(0) 18 self.blocks().nth(0)
19 } 19 }
20 pub fn else_branch(&self) -> Option<ElseBranch> { 20 pub fn else_branch(&self) -> Option<ElseBranch> {
@@ -28,7 +28,7 @@ impl ast::IfExpr {
28 Some(res) 28 Some(res)
29 } 29 }
30 30
31 fn blocks(&self) -> AstChildren<ast::Block> { 31 fn blocks(&self) -> AstChildren<ast::BlockExpr> {
32 children(self) 32 children(self)
33 } 33 }
34} 34}
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index fd85a3231..e2a92ae60 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -3135,7 +3135,7 @@ impl AstNode for TryBlockExpr {
3135 } 3135 }
3136} 3136}
3137impl TryBlockExpr { 3137impl TryBlockExpr {
3138 pub fn block(&self) -> Option<Block> { 3138 pub fn body(&self) -> Option<BlockExpr> {
3139 AstChildren::new(&self.syntax).next() 3139 AstChildren::new(&self.syntax).next()
3140 } 3140 }
3141} 3141}
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs
index 20c251fba..c3e676d4c 100644
--- a/crates/ra_syntax/src/ast/traits.rs
+++ b/crates/ra_syntax/src/ast/traits.rs
@@ -28,7 +28,7 @@ pub trait VisibilityOwner: AstNode {
28} 28}
29 29
30pub trait LoopBodyOwner: AstNode { 30pub trait LoopBodyOwner: AstNode {
31 fn loop_body(&self) -> Option<ast::Block> { 31 fn loop_body(&self) -> Option<ast::BlockExpr> {
32 child_opt(self) 32 child_opt(self)
33 } 33 }
34} 34}
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index 37166182f..c14ee0e85 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -426,7 +426,7 @@ Grammar(
426 traits: ["LoopBodyOwner"], 426 traits: ["LoopBodyOwner"],
427 ), 427 ),
428 "TryBlockExpr": ( 428 "TryBlockExpr": (
429 options: ["Block"], 429 options: [["body", "BlockExpr"]],
430 ), 430 ),
431 "ForExpr": ( 431 "ForExpr": (
432 traits: ["LoopBodyOwner"], 432 traits: ["LoopBodyOwner"],