mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
move hashmap to its own module for now
This commit is contained in:
@ -156,14 +156,14 @@ pub fn (v &V) finalize_compilation() {
|
||||
pub fn (v mut V) add_parser(parser Parser) int {
|
||||
pidx := v.parsers.len
|
||||
v.parsers << parser
|
||||
file_path := if filepath.is_abs(parser.file_path) {
|
||||
file_path := if filepath.is_abs(parser.file_path) {
|
||||
parser.file_path } else { os.realpath(parser.file_path) }
|
||||
v.file_parser_idx[file_path] = pidx
|
||||
return pidx
|
||||
}
|
||||
|
||||
pub fn (v &V) get_file_parser_index(file string) ?int {
|
||||
file_path := if filepath.is_abs(file) {
|
||||
file_path := if filepath.is_abs(file) {
|
||||
file } else { os.realpath(file) }
|
||||
if file_path in v.file_parser_idx {
|
||||
return v.file_parser_idx[file_path]
|
||||
@ -1058,7 +1058,7 @@ pub fn new_v(args []string) &V {
|
||||
is_live: '-live' in args
|
||||
sanitize: '-sanitize' in args
|
||||
// nofmt: '-nofmt' in args
|
||||
|
||||
|
||||
show_c_cmd: '-show_c_cmd' in args
|
||||
translated: 'translated' in args
|
||||
is_run: 'run' in args
|
||||
@ -1077,7 +1077,7 @@ pub fn new_v(args []string) &V {
|
||||
building_v: !is_repl && (rdir_name == 'compiler' || rdir_name == 'v.v' || dir.contains('vlib'))
|
||||
comptime_define: comptime_define
|
||||
// is_fmt: comptime_define == 'vfmt'
|
||||
|
||||
|
||||
user_mod_path: user_mod_path
|
||||
vlib_path: vlib_path
|
||||
vpath: vpath
|
||||
@ -1145,7 +1145,6 @@ pub fn vfmt(args []string) {
|
||||
println('v fmt can only be used on .v files')
|
||||
exit(1)
|
||||
}
|
||||
println('WIP')
|
||||
vexe := vexe_path()
|
||||
// launch_tool('vfmt', '-d vfmt')
|
||||
vroot := os.dir(vexe)
|
||||
|
Reference in New Issue
Block a user