From dcb4c0ada632cef565894775e12b8cd2ce69e044 Mon Sep 17 00:00:00 2001 From: Callym Date: Sun, 10 Jan 2021 13:58:09 +0000 Subject: Allow `true` and `false` keywords in const generics --- crates/parser/src/grammar/type_args.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/parser') 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) { } // test type_arg -// type A = B<'static, i32, 1, { 2 }, Item=u64>; +// type A = B<'static, i32, 1, { 2 }, Item=u64, true, false>; fn generic_arg(p: &mut Parser) { let m = p.start(); match p.current() { @@ -55,6 +55,10 @@ fn generic_arg(p: &mut Parser) { expressions::literal(p); m.complete(p, CONST_ARG); } + TRUE_KW | FALSE_KW => { + expressions::literal(p); + m.complete(p, CONST_ARG); + } _ => { types::type_(p); m.complete(p, TYPE_ARG); -- cgit v1.2.3