From 6acf32b869297008625c13739ee30ec8122bbed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kr=C3=BCger?= <45282134+UweKrueger@users.noreply.github.com> Date: Sat, 12 Jun 2021 16:01:37 +0200 Subject: [PATCH] v.parser: prepare for splitting of `map.v` (#10432) --- vlib/v/parser/parser.v | 4 ++-- vlib/v/parser/pratt.v | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 71924d601a..18eea763aa 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -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) diff --git a/vlib/v/parser/pratt.v b/vlib/v/parser/pratt.v index 46105dbc11..a97089e285 100644 --- a/vlib/v/parser/pratt.v +++ b/vlib/v/parser/pratt.v @@ -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()