From 42da26e9597443812da5a59b3fa48bdcbf619666 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 17 Nov 2020 20:02:46 +0100 Subject: parser,syntax: Add separate parser for stmt with optional semicolon Adjusting `grammar::fragments::stmt` to Optional or Yes will break original functionality and tests. --- crates/syntax/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/syntax/src') 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 { impl ast::Stmt { /// Returns `text`, parsed as statement, but only if it has no errors. pub fn parse(text: &str) -> Result { - parsing::parse_text_fragment(text, parser::FragmentKind::Statement) + parsing::parse_text_fragment(text, parser::FragmentKind::StatementOptionalSemi) } } -- cgit v1.2.3