mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
add builtin import pass + use builder in map
This commit is contained in:
parent
5ed338dc2e
commit
2fab73983b
@ -948,6 +948,12 @@ fn (v mut V) add_v_files_to_compile() {
|
|||||||
}
|
}
|
||||||
// import tables for user/lib files
|
// import tables for user/lib files
|
||||||
mut file_imports := []FileImportTable
|
mut file_imports := []FileImportTable
|
||||||
|
// Parse builtin imports
|
||||||
|
for file in v.files {
|
||||||
|
mut p := v.new_parser(file, Pass.imports)
|
||||||
|
p.parse()
|
||||||
|
file_imports << *p.import_table
|
||||||
|
}
|
||||||
// Parse user imports
|
// Parse user imports
|
||||||
for file in user_files {
|
for file in user_files {
|
||||||
mut p := v.new_parser(file, Pass.imports)
|
mut p := v.new_parser(file, Pass.imports)
|
||||||
|
@ -249,15 +249,11 @@ pub fn (m map_string) str() string {
|
|||||||
return '{}'
|
return '{}'
|
||||||
}
|
}
|
||||||
// TODO use bytes buffer
|
// TODO use bytes buffer
|
||||||
//mut sb := strings.new_builder(50)
|
mut sb := strings.new_builder(50)
|
||||||
//sb.writeln('{')
|
sb.writeln('{')
|
||||||
mut s := '{\n'
|
|
||||||
for key, val in m {
|
for key, val in m {
|
||||||
//sb.writeln(' "$entry.key" => "$val"')
|
sb.writeln(' "$key" => "$val"')
|
||||||
s += ' "$key" => "$val"\n'
|
|
||||||
}
|
}
|
||||||
s += '}\n'
|
sb.writeln('}')
|
||||||
//sb.writeln('}')
|
return sb.str()
|
||||||
//return sb.str()
|
|
||||||
return s
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user