1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.parser: fix running math programs, from V installed in folders containing .v

This commit is contained in:
Delyan Angelov 2021-08-31 09:16:03 +03:00
parent ebed01c946
commit 37b4553f52
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -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 {