aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src/grammar
diff options
context:
space:
mode:
authorCallym <[email protected]>2021-01-10 13:58:09 +0000
committerCallym <[email protected]>2021-01-10 13:58:09 +0000
commitdcb4c0ada632cef565894775e12b8cd2ce69e044 (patch)
treed117034987a35db75c049c511ffd2ba17cc1baf0 /crates/parser/src/grammar
parent77362c71735a8b5ab4b5cd9f396fa657fbffe2cb (diff)
Allow `true` and `false` keywords in const generics
Diffstat (limited to 'crates/parser/src/grammar')
-rw-r--r--crates/parser/src/grammar/type_args.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/parser/src/grammar/type_args.rs b/crates/parser/src/grammar/type_args.rs
index a013c49b9..debb23fea 100644
--- a/crates/parser/src/grammar/type_args.rs
+++ b/crates/parser/src/grammar/type_args.rs
@@ -26,7 +26,7 @@ pub(super) fn opt_generic_arg_list(p: &mut Parser, colon_colon_required: bool) {
26} 26}
27 27
28// test type_arg 28// test type_arg
29// type A = B<'static, i32, 1, { 2 }, Item=u64>; 29// type A = B<'static, i32, 1, { 2 }, Item=u64, true, false>;
30fn generic_arg(p: &mut Parser) { 30fn generic_arg(p: &mut Parser) {
31 let m = p.start(); 31 let m = p.start();
32 match p.current() { 32 match p.current() {
@@ -55,6 +55,10 @@ fn generic_arg(p: &mut Parser) {
55 expressions::literal(p); 55 expressions::literal(p);
56 m.complete(p, CONST_ARG); 56 m.complete(p, CONST_ARG);
57 } 57 }
58 TRUE_KW | FALSE_KW => {
59 expressions::literal(p);
60 m.complete(p, CONST_ARG);
61 }
58 _ => { 62 _ => {
59 types::type_(p); 63 types::type_(p);
60 m.complete(p, TYPE_ARG); 64 m.complete(p, TYPE_ARG);