mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
25 lines
592 B
V
25 lines
592 B
V
module main
|
|
|
|
import v.pref
|
|
import v.eval
|
|
import v.util
|
|
import v.builder
|
|
|
|
fn main() {
|
|
mut args_and_flags := util.join_env_vflags_and_os_args()[1..].filter(it != 'interpret')
|
|
prefs, _ := pref.parse_args([], args_and_flags)
|
|
builder.compile('interpret', prefs, v_interpret)
|
|
}
|
|
|
|
fn v_interpret(mut b builder.Builder) {
|
|
mut files := b.get_builtin_files()
|
|
files << b.get_user_files()
|
|
b.set_module_lookup_paths()
|
|
b.front_and_middle_stages(files) or { return }
|
|
|
|
util.timing_start('INTERPRET')
|
|
mut e := eval.new_eval(b.table, b.pref)
|
|
e.eval(b.parsed_files)
|
|
util.timing_measure('INTERPRET')
|
|
}
|