aboutsummaryrefslogtreecommitdiff
path: root/crates/parser
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-10 14:06:03 +0000
committerGitHub <[email protected]>2021-01-10 14:06:03 +0000
commit8e54fa67cc4cc7460cc346283f96983d38b9e790 (patch)
treed117034987a35db75c049c511ffd2ba17cc1baf0 /crates/parser
parent77362c71735a8b5ab4b5cd9f396fa657fbffe2cb (diff)
parentdcb4c0ada632cef565894775e12b8cd2ce69e044 (diff)
Merge #7234
7234: Allow `true` and `false` keywords in const generics r=lnicola a=callym This should fix #7232 - hopefully I've done it right, it passes the tests and the rast file looks like it's picking up the true and false in the test Co-authored-by: Callym <[email protected]>
Diffstat (limited to 'crates/parser')
-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);