code wiki / (root) / lex_float_test.nx

lex_float_test.nx

buildroot/runtime/lex_float_test.nx

3106 B65 linesdepth 4pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic lex
docsdependenciesstructsconstsfunctions

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

syscalls.nx types.nx lex_kinds.nx lex.nx lex_float_test.nx

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

main lex_source skip_ws_comments peek advance peek2 peek ↻ is_alpha lex_ident_or_kw tok_text_ptr peek ↻ is_alnum is_alpha ↻ is_digit advance ↻ keyword_lookup push_tok is_digit ↻ lex_number peek ↻ peek2 ↻ advance ↻ is_hexdigit is_digit ↻ hex_val push_tok ↻ is_digit ↻ lex_string advance ↻ tok_text_ptr ↻ peek ↻ push_tok ↻ peek2 ↻ emit_punct advance ↻ push_tok ↻ advance ↻ push_tok ↻

structs

none

consts

none

functions

24func main() -> i64 {
calls 1: lex_source