-
This commit is contained in:
16
main.v
16
main.v
@@ -7,17 +7,23 @@ fn main() {
|
||||
content := os.read_file("source.one") or { return }
|
||||
println("---------\n" + content + "---------")
|
||||
tokens := lex(content) or { return }
|
||||
println("-- TOK --")
|
||||
print_toks(tokens)
|
||||
|
||||
$if debug {
|
||||
println("-- TOK --")
|
||||
print_toks(tokens)
|
||||
}
|
||||
|
||||
mut parser := Parser{
|
||||
tokens: tokens
|
||||
pos: 0
|
||||
}
|
||||
|
||||
statements := parser.parse_program()
|
||||
|
||||
println("-- AST --")
|
||||
println(statements)
|
||||
$if debug {
|
||||
println("-- AST --")
|
||||
println(statements)
|
||||
}
|
||||
|
||||
mut generator := Generator{
|
||||
out: strings.new_builder(100)
|
||||
@@ -25,8 +31,6 @@ fn main() {
|
||||
|
||||
out_c := generator.gen_c(statements)
|
||||
|
||||
println("--- C ---")
|
||||
println(out_c)
|
||||
compile_with_clang(out_c, 'test', true)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user