aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src/grammar/expressions
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2020-12-23 01:15:30 +0000
committerLukas Wirth <[email protected]>2020-12-23 01:15:44 +0000
commit2c94c4964aa6242098f97ca3421a750a763567b4 (patch)
tree2474ee18f391cffd027b5ebdce7ddb5c7e43e8c3 /crates/parser/src/grammar/expressions
parent03a9bbacf2a82faaecc269c1d97dea392f4f9874 (diff)
Parse const effect block
Diffstat (limited to 'crates/parser/src/grammar/expressions')
-rw-r--r--crates/parser/src/grammar/expressions/atom.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs
index e897d5a52..c7a3556a7 100644
--- a/crates/parser/src/grammar/expressions/atom.rs
+++ b/crates/parser/src/grammar/expressions/atom.rs
@@ -46,6 +46,7 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet =
46 T![continue], 46 T![continue],
47 T![async], 47 T![async],
48 T![try], 48 T![try],
49 T![const],
49 T![loop], 50 T![loop],
50 T![for], 51 T![for],
51 LIFETIME_IDENT, 52 LIFETIME_IDENT,
@@ -115,6 +116,14 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
115 block_expr(p); 116 block_expr(p);
116 m.complete(p, EFFECT_EXPR) 117 m.complete(p, EFFECT_EXPR)
117 } 118 }
119 // test const_block
120 // fn f() { const { } }
121 T![const] if la == T!['{'] => {
122 let m = p.start();
123 p.bump(T![const]);
124 block_expr(p);
125 m.complete(p, EFFECT_EXPR)
126 }
118 T!['{'] => { 127 T!['{'] => {
119 // test for_range_from 128 // test for_range_from
120 // fn foo() { 129 // fn foo() {