1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix match x { mod.constname {} } handling

This commit is contained in:
Delyan Angelov 2020-06-22 16:16:33 +03:00
parent d232833573
commit b930a11203

View File

@ -118,7 +118,7 @@ fn (mut p Parser) match_expr() ast.MatchExpr {
p.next() p.next()
} else if p.tok.kind == .name && !(p.tok.lit == 'C' && p.peek_tok.kind == .dot) && } else if p.tok.kind == .name && !(p.tok.lit == 'C' && p.peek_tok.kind == .dot) &&
(p.tok.lit in table.builtin_type_names || (p.tok.lit[0].is_capital() && !p.tok.lit.is_upper()) || (p.tok.lit in table.builtin_type_names || (p.tok.lit[0].is_capital() && !p.tok.lit.is_upper()) ||
p.peek_tok.kind == .dot) { (p.peek_tok.kind == .dot && p.peek_tok2.lit[0].is_capital() ) ) {
if var_name.len == 0 { if var_name.len == 0 {
match cond { match cond {
ast.Ident { ast.Ident {