v.parser: prepare for splitting of `map.v` (#10432)

pull/10438/head
Uwe Krüger 2021-06-12 16:01:37 +02:00 committed by GitHub
parent e70bde54dc
commit 6acf32b869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -2086,8 +2086,8 @@ pub fn (mut p Parser) name_expr() ast.Expr {
&& !p.inside_match_case && (!p.inside_if || p.inside_select)
&& (!p.inside_for || p.inside_select) { // && (p.tok.lit[0].is_capital() || p.builtin_mod) {
// map.v has struct literal: map{field: expr}
if p.peek_tok.kind == .lcbr && !(p.builtin_mod && p.file_base == 'map.v')
&& p.tok.lit == 'map' {
if p.peek_tok.kind == .lcbr && !(p.builtin_mod
&& p.file_base in ['map.v', 'map_d_gcboehm_opt.v']) && p.tok.lit == 'map' {
// map{key_expr: val_expr}
p.check(.name)
p.check(.lcbr)

View File

@ -49,7 +49,7 @@ pub fn (mut p Parser) check_expr(precedence int) ?ast.Expr {
node = p.sql_expr()
p.inside_match = false
} else if p.tok.lit == 'map' && p.peek_tok.kind == .lcbr && !(p.builtin_mod
&& p.file_base == 'map.v') {
&& p.file_base in ['map.v', 'map_d_gcboehm_opt.v']) {
p.next() // `map`
p.next() // `{`
node = p.map_init()