aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/parser/src')
-rw-r--r--crates/parser/src/grammar/attributes.rs3
-rw-r--r--crates/parser/src/grammar/expressions.rs2
-rw-r--r--crates/parser/src/grammar/expressions/atom.rs8
-rw-r--r--crates/parser/src/syntax_kind/generated.rs2
4 files changed, 8 insertions, 7 deletions
diff --git a/crates/parser/src/grammar/attributes.rs b/crates/parser/src/grammar/attributes.rs
index b8242cd2f..a44c5e484 100644
--- a/crates/parser/src/grammar/attributes.rs
+++ b/crates/parser/src/grammar/attributes.rs
@@ -13,6 +13,7 @@ pub(super) fn outer_attrs(p: &mut Parser) {
13} 13}
14 14
15pub(super) fn meta(p: &mut Parser) { 15pub(super) fn meta(p: &mut Parser) {
16 let meta = p.start();
16 paths::use_path(p); 17 paths::use_path(p);
17 18
18 match p.current() { 19 match p.current() {
@@ -25,6 +26,8 @@ pub(super) fn meta(p: &mut Parser) {
25 T!['('] | T!['['] | T!['{'] => items::token_tree(p), 26 T!['('] | T!['['] | T!['{'] => items::token_tree(p),
26 _ => {} 27 _ => {}
27 } 28 }
29
30 meta.complete(p, META);
28} 31}
29 32
30fn attr(p: &mut Parser, inner: bool) { 33fn attr(p: &mut Parser, inner: bool) {
diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs
index 9d22e1950..686a64345 100644
--- a/crates/parser/src/grammar/expressions.rs
+++ b/crates/parser/src/grammar/expressions.rs
@@ -208,7 +208,7 @@ struct Restrictions {
208 208
209/// Binding powers of operators for a Pratt parser. 209/// Binding powers of operators for a Pratt parser.
210/// 210///
211/// See https://www.oilshell.org/blog/2016/11/03.html 211/// See <https://www.oilshell.org/blog/2016/11/03.html>
212#[rustfmt::skip] 212#[rustfmt::skip]
213fn current_op(p: &Parser) -> (u8, SyntaxKind) { 213fn current_op(p: &Parser) -> (u8, SyntaxKind) {
214 const NOT_AN_OP: (u8, SyntaxKind) = (0, T![@]); 214 const NOT_AN_OP: (u8, SyntaxKind) = (0, T![@]);
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs
index 269f223e6..abdfca1fe 100644
--- a/crates/parser/src/grammar/expressions/atom.rs
+++ b/crates/parser/src/grammar/expressions/atom.rs
@@ -252,12 +252,10 @@ fn closure_expr(p: &mut Parser) -> CompletedMarker {
252 // test lambda_ret_block 252 // test lambda_ret_block
253 // fn main() { || -> i32 { 92 }(); } 253 // fn main() { || -> i32 { 92 }(); }
254 block_expr(p); 254 block_expr(p);
255 } else if p.at_ts(EXPR_FIRST) {
256 expr(p);
255 } else { 257 } else {
256 if p.at_ts(EXPR_FIRST) { 258 p.error("expected expression");
257 expr(p);
258 } else {
259 p.error("expected expression");
260 }
261 } 259 }
262 m.complete(p, CLOSURE_EXPR) 260 m.complete(p, CLOSURE_EXPR)
263} 261}
diff --git a/crates/parser/src/syntax_kind/generated.rs b/crates/parser/src/syntax_kind/generated.rs
index bcefd183a..5f10b82de 100644
--- a/crates/parser/src/syntax_kind/generated.rs
+++ b/crates/parser/src/syntax_kind/generated.rs
@@ -220,7 +220,7 @@ pub enum SyntaxKind {
220 ITEM_LIST, 220 ITEM_LIST,
221 ASSOC_ITEM_LIST, 221 ASSOC_ITEM_LIST,
222 ATTR, 222 ATTR,
223 META_ITEM, 223 META,
224 USE_TREE, 224 USE_TREE,
225 USE_TREE_LIST, 225 USE_TREE_LIST,
226 PATH, 226 PATH,