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

pull/11353/head
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
1 changed files with 1 additions and 1 deletions

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') { if p.file_base.ends_with('_test.v') || p.file_base.ends_with('_test.vv') {
p.inside_test_file = true 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('.') language := before_dot_v.all_after_last('.')
langauge_with_underscore := 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 { if language == before_dot_v && langauge_with_underscore == before_dot_v {