code wiki / (root) / prop_lex_number_test.nx

prop_lex_number_test.nx

buildroot/runtime/prop_lex_number_test.nx

2734 B86 linesdepth 4pulls 10 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

prop_lex_number_test.nx -- property test for lex_source on numbers. Property: for every random decimal digit sequence D with value V, lex_source(D) produces exactly one TK_INT with int_val == V. Catches: * Overflow in the digit accumulator (V doesn't match hand math) * Off-by-one in digit iteration * Mis-tokenising legal digit chars as something else * Crash on edge cases (leading zeros, max i64 magnitude, etc.) Runs 2000 iterations. Each iteration picks a random number of digits (1..18 -- safely under i64 range for uniform digits).

dependencies 5 imports · 0 importers

syscalls.nx types.nx lex_kinds.nx lex.nx prop_test.nx prop_lex_number_test.nx

imports: syscalls.nxtypes.nxlex_kinds.nxlex.nxprop_test.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main prop_gen_new prop_gen_range prop_gen_i64 ascii_to_i64 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 ↻

structs

none

consts

none

functions

23func ascii_to_i64(buf: *u8, n: i64) -> i64 {
called by 1: main
33func main() -> i64 {