1
0
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:
Abdullah Atta
2020-04-16 02:16:49 +05:00
committed by GitHub
parent a3ab5df2ed
commit 6a186e8f11
21 changed files with 1592 additions and 313 deletions

View File

@@ -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)