lex_float_test.nx
buildroot/runtime/lex_float_test.nx
about
lex_float_test.nx -- self-test for TK_FLOAT lexing.
Verifies:
(1) "3.14" -> TK_FLOAT, int_val=3, text0=14, text1=2
(2) "0.5" -> TK_FLOAT, int_val=0, text0=5, text1=1
(3) "42" -> TK_INT , int_val=42 (integer unchanged)
(4) "1.0f" -> TK_FLOAT, int_val=1, text0=0, text1=1 (suffix
consumed)
(5) "2.718e0" -> TK_FLOAT on the "2.718" portion. Exponent
tokenisation isn't wired yet; the 'e0' tail
falls through to the identifier lexer. This
test confirms the float portion is correctly
isolated.
Once parse.nx consumes TK_FLOAT + emits VK_CONST_FLOAT into the IR,
end-to-end f32 codegen (the final piece after regalloc dfe10f8) is
runnable.
dependencies 4 imports · 0 importers
imports: syscalls.nxtypes.nxlex_kinds.nxlex.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 24 | func main() -> i64 {
calls 1: lex_source |