mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: do not prepend mod to selectively imported types from nested module (#8805)
This commit is contained in:
parent
ab6517c5fc
commit
600f6ad2a0
@ -80,9 +80,11 @@ pub fn fmt(file ast.File, table &table.Table, pref &pref.Preferences, is_debug b
|
||||
|
||||
pub fn (mut f Fmt) process_file_imports(file &ast.File) {
|
||||
for imp in file.imports {
|
||||
f.mod2alias[imp.mod.all_after_last('.')] = imp.alias
|
||||
mod := imp.mod.all_after_last('.')
|
||||
f.mod2alias[mod] = imp.alias
|
||||
for sym in imp.syms {
|
||||
f.mod2alias['${imp.mod}.$sym.name'] = sym.name
|
||||
f.mod2alias['${mod}.$sym.name'] = sym.name
|
||||
f.mod2alias[sym.name] = sym.name
|
||||
f.import_syms_used[sym.name] = false
|
||||
}
|
||||
|
@ -1,12 +1,18 @@
|
||||
import math { max, min }
|
||||
import math.complex { complex, Complex }
|
||||
import os {
|
||||
user_os,
|
||||
file_ext,
|
||||
}
|
||||
|
||||
fn imaginary(im f64) Complex {
|
||||
return complex(0, im)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println(max(0.1, 0.2))
|
||||
println(min(0.1, 0.2))
|
||||
println(user_os())
|
||||
println(file_ext('main.v'))
|
||||
println(imaginary(1))
|
||||
}
|
||||
|
@ -1,12 +1,18 @@
|
||||
import math { max,
|
||||
min,
|
||||
}
|
||||
import math.complex { complex, Complex }
|
||||
import os {
|
||||
input, user_os, file_ext }
|
||||
|
||||
fn imaginary(im f64) Complex {
|
||||
return complex(0, im)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println(max(0.1, 0.2))
|
||||
println(min(0.1, 0.2))
|
||||
println(user_os())
|
||||
println(file_ext('main.v'))
|
||||
println(imaginary(1))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user