From 37b4553f5228b9059786f700a980babb1e35739a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 31 Aug 2021 09:16:03 +0300 Subject: [PATCH] v.parser: fix running `math` programs, from V installed in folders containing `.v` --- vlib/v/parser/parser.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 0924abe5c5..449ad07465 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -145,7 +145,7 @@ pub fn (mut p Parser) set_path(path string) { if p.file_base.ends_with('_test.v') || p.file_base.ends_with('_test.vv') { p.inside_test_file = true } - before_dot_v := path.before('.v') // also works for .vv and .vsh + before_dot_v := path.all_before_last('.v') // also works for .vv and .vsh language := before_dot_v.all_after_last('.') langauge_with_underscore := before_dot_v.all_after_last('_') if language == before_dot_v && langauge_with_underscore == before_dot_v {