mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
v.utils: fix module lookup if module import parts end with the word modules
(#21083)
This commit is contained in:
parent
cf9746da5a
commit
f66b5954c2
3 changed files with 5 additions and 2 deletions
2
.github/workflows/linux_ci.yml
vendored
2
.github/workflows/linux_ci.yml
vendored
|
@ -57,6 +57,8 @@ jobs:
|
||||||
# run: V_CI_CSTRICT=1 ./v -cstrict test-self
|
# run: V_CI_CSTRICT=1 ./v -cstrict test-self
|
||||||
- name: Build examples
|
- name: Build examples
|
||||||
run: ./v -W build-examples
|
run: ./v -W build-examples
|
||||||
|
- name: Run the submodule example, using a relative path
|
||||||
|
run: ./v -W run examples/submodule
|
||||||
- name: Build v tools
|
- name: Build v tools
|
||||||
run: ./v -W build-tools
|
run: ./v -W build-tools
|
||||||
- name: Build v binaries
|
- name: Build v binaries
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module mymodule
|
module mymodules
|
||||||
|
|
||||||
pub fn add_xy(x int, y int) int {
|
pub fn add_xy(x int, y int) int {
|
||||||
return x + y
|
return x + y
|
||||||
|
|
|
@ -107,8 +107,9 @@ fn mod_path_to_full_name(pref_ &pref.Preferences, mod string, path string) !stri
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mut in_vmod_path := false
|
mut in_vmod_path := false
|
||||||
|
parts := path.split(os.path_separator)
|
||||||
for vmod_folder in vmod_folders {
|
for vmod_folder in vmod_folders {
|
||||||
if path.contains(vmod_folder + os.path_separator) {
|
if vmod_folder in parts {
|
||||||
in_vmod_path = true
|
in_vmod_path = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue