24 lines
459 B
Plaintext
24 lines
459 B
Plaintext
import "@std"
|
|
import "@std/debug"
|
|
import "@std/mem"
|
|
import "@std/arraylist"
|
|
|
|
program ::
|
|
`# these are immutable
|
|
`x :: 32
|
|
`y :: 3.2
|
|
|
|
main func() void {
|
|
tokens std.ArrayList(Token) = arraylist.init(mem.c_allocator)
|
|
defer arraylist.deinit(&tokens)
|
|
|
|
scan(&tokens, program) catch |_| {
|
|
debug.print("failed to scan: out of memory\n", {})
|
|
return
|
|
}
|
|
|
|
for tokens.items |token| {
|
|
debug.print("{}\n", { token.kind })
|
|
}
|
|
}
|