mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
jsgen: implement js backend
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
struct FormatOptions {
|
||||
is_l bool
|
||||
is_c bool
|
||||
is_js bool
|
||||
is_w bool
|
||||
is_diff bool
|
||||
is_verbose bool
|
||||
@@ -51,6 +52,7 @@ fn main() {
|
||||
args := util.join_env_vflags_and_os_args()
|
||||
foptions := FormatOptions{
|
||||
is_c: '-c' in args
|
||||
is_js: '-js' in args
|
||||
is_l: '-l' in args
|
||||
is_w: '-w' in args
|
||||
is_diff: '-diff' in args
|
||||
@@ -200,7 +202,7 @@ fn (foptions &FormatOptions) post_process_file(file string, formatted_file_path
|
||||
return
|
||||
}
|
||||
is_formatted_different := fc != formatted_fc
|
||||
if foptions.is_c {
|
||||
if foptions.is_c || foptions.is_js {
|
||||
if is_formatted_different {
|
||||
eprintln('File is not formatted: $file')
|
||||
exit(2)
|
||||
|
||||
@@ -160,6 +160,13 @@ fn parse_args(args []string) (&pref.Preferences, string) {
|
||||
res.out_name = cmdline.option(args, '-o', '')
|
||||
i++
|
||||
}
|
||||
'-b' {
|
||||
b := pref.backend_from_string(cmdline.option(args, '-b', 'c')) or {
|
||||
continue
|
||||
}
|
||||
res.backend = b
|
||||
i++
|
||||
}
|
||||
else {
|
||||
mut should_continue := false
|
||||
for flag_with_param in list_of_flags_with_param {
|
||||
|
||||
Reference in New Issue
Block a user