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

string: last_index ?int

This commit is contained in:
Alexander Medvednikov
2019-12-12 21:44:52 +03:00
parent 8e1c27d129
commit b8f728590b
5 changed files with 28 additions and 29 deletions

View File

@ -759,11 +759,13 @@ pub fn (v &V) get_user_files() []string {
// v volt/slack_test.v: compile all .v files to get the environment
// I need to implement user packages! TODO
is_test_with_imports := dir.ends_with('_test.v') &&
(dir.contains('${os.path_separator}volt') || dir.contains('${os.path_separator}c2volt'))// TODO
(dir.contains('${os.path_separator}volt') ||
dir.contains('${os.path_separator}c2volt'))// TODO
if is_test_with_imports {
user_files << dir
pos := dir.last_index(os.path_separator)
dir = dir[..pos] + os.path_separator// TODO why is this needed
if pos := dir.last_index(os.path_separator) {
dir = dir[..pos] + os.path_separator// TODO why is this needed
}
}
if dir.ends_with('.v') || dir.ends_with('.vsh') {
// Just compile one file and get parent dir