v.parser: prepare for splitting of `map.v` (#10432)
parent
e70bde54dc
commit
6acf32b869
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue