aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src/grammar.rs
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/parser/src/grammar.rs
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/parser/src/grammar.rs')
-rw-r--r--crates/parser/src/grammar.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs
index 63cc90027..bb9ffea8b 100644
--- a/crates/parser/src/grammar.rs
+++ b/crates/parser/src/grammar.rs
@@ -66,6 +66,10 @@ pub(crate) mod fragments {
66 expressions::stmt(p, expressions::StmtWithSemi::No) 66 expressions::stmt(p, expressions::StmtWithSemi::No)
67 } 67 }
68 68
69 pub(crate) fn stmt_optional_semi(p: &mut Parser) {
70 expressions::stmt(p, expressions::StmtWithSemi::Optional)
71 }
72
69 pub(crate) fn opt_visibility(p: &mut Parser) { 73 pub(crate) fn opt_visibility(p: &mut Parser) {
70 let _ = super::opt_visibility(p); 74 let _ = super::opt_visibility(p);
71 } 75 }