code wiki / (root) / smoke_lex_min.nx

smoke_lex_min.nx source

↩ module page · 17 lines · 481 B

1// smoke_lex_min.nx -- minimal lex_source call. 2// 3// If this segfaults the bug is in lex.nx or its codegen interaction. 4// If this exits 0 the bug is something specific lex_test does after. 5 6import "syscalls.nx" 7import "lex_kinds.nx" 8import "lex.nx" 9 10func main() -> i64 { 11 let src: *u8 = "f" 12 let toks: *Tok = lex_source(src, 16) 13 if toks == (0 as *Tok) { 14 return __syscall(93, 1, 0, 0, 0, 0, 0) 15 } 16 return __syscall(93, 0, 0, 0, 0, 0, 0) 17}