diff options
author | Yerkebulan Tulibergenov <[email protected]> | 2019-01-16 04:26:46 +0000 |
---|---|---|
committer | Yerkebulan Tulibergenov <[email protected]> | 2019-01-16 04:26:46 +0000 |
commit | 5e35f191fc5e1055f8696c82c39cfa2a3ac70bff (patch) | |
tree | c8261ec2c2db4829883edb927aa2dc56f06fda12 | |
parent | 4149285bf55c4a7c10b6e72c83addb675b48a687 (diff) |
add has_semi to ExprStmt
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 8bf439b60..e6b5e407d 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -296,6 +296,15 @@ impl IfExpr { | |||
296 | } | 296 | } |
297 | } | 297 | } |
298 | 298 | ||
299 | impl ExprStmt { | ||
300 | pub fn has_semi(&self) -> bool { | ||
301 | match self.syntax().last_child() { | ||
302 | None => false, | ||
303 | Some(node) => node.kind() == SEMI, | ||
304 | } | ||
305 | } | ||
306 | } | ||
307 | |||
299 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 308 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
300 | pub enum PathSegmentKind<'a> { | 309 | pub enum PathSegmentKind<'a> { |
301 | Name(&'a NameRef), | 310 | Name(&'a NameRef), |