Compare commits

...

3 Commits

Author SHA1 Message Date
d3066748b2 add list mnemonic 2025-09-23 16:16:06 +02:00
f17b2c1087 remove debug 2025-09-23 16:12:48 +02:00
fa71f23bbf delete 2025-09-23 16:09:29 +02:00
3 changed files with 797 additions and 824 deletions

View File

@ -1,10 +1,4 @@
(fn dbg (msg) (do
(if is_phi_compiler (do
(call println "dbg: %" msg)
))
))
(fn Emitter (ast filename) (do
(let output ())
@ -41,12 +35,6 @@
(call define_builtin ident builtin_id)
))
(let is_phi_compiler_sym_id (call define_let "is_phi_compiler" 0))
(call emit (call format
"let _is_phi_compiler% = { type: \"bool\", value: true };\n"
is_phi_compiler_sym_id
))
(call discover_syms ast)
(call emit_exprs ast)
(return (call strings_join output))
@ -99,7 +87,6 @@
(let sym (call get_sym value))
(if (== sym null) (do
(call print_syms)
(call panic "undefined symbol '%' on line %" value line)
))
@ -242,6 +229,8 @@
))
(call emit "))")
) (if (== id "list") (do
(call emit_list_literal (call slice s 1))
) (if (== id "=") (do
(call emit_assign_expr s line "=")
) (if (== id "+=") (do
@ -287,7 +276,7 @@
(call emit ")")
) (do
(call emit_list_literal s)
))))))))))))))))))))))))
)))))))))))))))))))))))))
))
(fn emit_list_literal (s) (do
@ -805,8 +794,8 @@
(let (emit) emitter)
(let js_code (call emit))
// (call println "=== js ===")
// (call println js_code)
(call println "=== js ===")
(call println js_code)
(if (not silent) (call println "writing file '%'..." output_filename))
(call write_text_file output_filename js_code)

View File

@ -1,7 +0,0 @@
(fn hello () (do
(call println "hello world")
(call println "hello world")
(return null)
))
(call hello)

1593
stage2.js

File diff suppressed because it is too large Load Diff