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

v2: string fixes, is_dir fix

This commit is contained in:
Alexander Medvednikov
2020-03-24 11:14:11 +01:00
parent 3d2fafa580
commit f101e9b9e2
6 changed files with 23 additions and 17 deletions

View File

@ -565,7 +565,7 @@ fn (p mut Parser) cast(typ string) {
p.expected_type = typ
expr_typ := p.bool_expression()
// Do not allow `int(my_int)`
if expr_typ == typ && typ != 'u64' {
if expr_typ == typ {
p.warn('casting `$typ` to `$expr_typ` is not needed')
}
// `face := FT_Face(cobj)` => `FT_Face face = *((FT_Face*)cobj);`

View File

@ -546,7 +546,7 @@ pub fn (v &V) v_files_from_dir(dir string) []string {
verror("$dir doesn't exist")
}
else if !os.is_dir(dir) {
verror("$dir isn't a directory")
verror("$dir isn't a directory!")
}
mut files := os.ls(dir)or{
panic(err)

View File

@ -170,10 +170,15 @@ fn (v mut V) set_module_lookup_paths() {
v.module_lookup_paths << os.base_dir(v.compiled_dir) // pdir of _test.v
}
v.module_lookup_paths << v.compiled_dir
x := os.join_path(v.compiled_dir, 'modules')
if v.pref.verbosity.is_higher_or_equal(.level_two) {
println('x: "$x"')
}
v.module_lookup_paths << os.join_path(v.compiled_dir, 'modules')
v.module_lookup_paths << v.pref.lookup_path
if v.pref.verbosity.is_higher_or_equal(.level_two) {
v.log('v.module_lookup_paths: $v.module_lookup_paths')
v.log('v.module_lookup_paths') //: $v.module_lookup_paths')
println(v.module_lookup_paths)
}
}