From 06fc8a830bb8b30470efab91b8f0f4dcc930894e Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 27 Feb 2020 03:30:17 +0100 Subject: [PATCH] v2: fix a bug with `mod.const` --- vlib/v/parser/module.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vlib/v/parser/module.v b/vlib/v/parser/module.v index b33e644d4d..66dd203c8e 100644 --- a/vlib/v/parser/module.v +++ b/vlib/v/parser/module.v @@ -2,16 +2,17 @@ // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. module parser - // return true if file being parsed imports `mod` pub fn (p &Parser) known_import(mod string) bool { return mod in p.imports } fn (p &Parser) prepend_mod(name string) string { + if p.expr_mod != '' { + return p.expr_mod + '.' + name + } if p.builtin_mod || p.mod == 'main' { return name } return '${p.mod}.$name' } -