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

ast: const impl & global scope & objects

This commit is contained in:
joe-conigliaro
2020-04-04 14:14:40 +11:00
parent bb5ed66bb4
commit bf59828897
13 changed files with 295 additions and 316 deletions

View File

@ -6,6 +6,7 @@ module main
import (
os
os.cmdline
v.ast
v.pref
v.fmt
v.util
@ -160,7 +161,7 @@ fn (foptions &FormatOptions) format_file(file string) {
eprintln('vfmt2 running fmt.fmt over file: $file')
}
table := table.new_table()
file_ast := parser.parse_file(file, table, .parse_comments, prefs)
file_ast := parser.parse_file(file, table, .parse_comments, prefs, &ast.Scope{parent: 0})
formatted_content := fmt.fmt(file_ast, table)
file_name := os.file_name(file)
vfmt_output_path := os.join_path(os.temp_dir(), 'vfmt_' + file_name)