aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src
diff options
context:
space:
mode:
authorMarijn Suijten <[email protected]>2020-11-17 19:02:46 +0000
committerMarijn Suijten <[email protected]>2021-01-03 11:05:52 +0000
commit42da26e9597443812da5a59b3fa48bdcbf619666 (patch)
tree8332cb8b91cd04fe0c15eec11f659b6095408112 /crates/syntax/src
parentcc081b7e1c68360ec157a31fa7fa32a38345e8d6 (diff)
parser,syntax: Add separate parser for stmt with optional semicolon
Adjusting `grammar::fragments::stmt` to Optional or Yes will break original functionality and tests.
Diffstat (limited to 'crates/syntax/src')
-rw-r--r--crates/syntax/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/syntax/src/lib.rs b/crates/syntax/src/lib.rs
index 51ae3da07..da151e328 100644
--- a/crates/syntax/src/lib.rs
+++ b/crates/syntax/src/lib.rs
@@ -215,7 +215,7 @@ impl ast::Attr {
215impl ast::Stmt { 215impl ast::Stmt {
216 /// Returns `text`, parsed as statement, but only if it has no errors. 216 /// Returns `text`, parsed as statement, but only if it has no errors.
217 pub fn parse(text: &str) -> Result<Self, ()> { 217 pub fn parse(text: &str) -> Result<Self, ()> {
218 parsing::parse_text_fragment(text, parser::FragmentKind::Statement) 218 parsing::parse_text_fragment(text, parser::FragmentKind::StatementOptionalSemi)
219 } 219 }
220} 220}
221 221