Allow true and false keywords in const generics

This commit is contained in:
Callym 2021-01-10 13:58:09 +00:00
parent 77362c7173
commit dcb4c0ada6
3 changed files with 25 additions and 11 deletions

View file

@ -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);