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
|
||||
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
|
||||
for file in user_files {
|
||||
mut p := v.new_parser(file, Pass.imports)
|
||||
|
@ -249,15 +249,11 @@ pub fn (m map_string) str() string {
|
||||
return '{}'
|
||||
}
|
||||
// TODO use bytes buffer
|
||||
//mut sb := strings.new_builder(50)
|
||||
//sb.writeln('{')
|
||||
mut s := '{\n'
|
||||
mut sb := strings.new_builder(50)
|
||||
sb.writeln('{')
|
||||
for key, val in m {
|
||||
//sb.writeln(' "$entry.key" => "$val"')
|
||||
s += ' "$key" => "$val"\n'
|
||||
sb.writeln(' "$key" => "$val"')
|
||||
}
|
||||
s += '}\n'
|
||||
//sb.writeln('}')
|
||||
//return sb.str()
|
||||
return s
|
||||
sb.writeln('}')
|
||||
return sb.str()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user