rizin/subprojects
Anton Kochkov 689bafb7a4
Rewrite the RzNum parser and calculator on tree-sitter (#4326)
Replace the hand-written parser in calc.c with a tree-sitter grammar
(subprojects/rizin-math-parser) and a typed evaluator. The old parser
could only ever produce a ut64 and folded anything it failed to read to
0, which left callers unable to tell a failed expression from one that
evaluated to zero.

Expressions now evaluate to an RzNumValue, a tagged union over ut64,
double, RzBitVector, arbitrary-precision integer and arbitrary-precision
decimal, carrying an RzNumError rather than signalling failure as 0.
Literals keep the width they were written with (5u8, 0xffu128, any width
from 1 to 65536), results that outgrow 64 bits promote to a big number on
their own, and a parse error, division by zero or unresolved identifier
reaches the caller.

rz_num_math() is deprecated. rz_num_math_ut64() keeps its exact behaviour
for callers that want a ut64, and rz_num_math_value() exposes the typed
result. rz_core_math() adds the RzCore-backed form used by the % command,
with rz_core_math_ut64() deprecated alongside it. rz-ax routes through the
typed API, so it prints values at full precision, reports errors on stderr
and exits non-zero. rz_il_lift_num() converts an expression to an
RzILOpPure, so a numeric argument can be lifted instead of pre-evaluated.

Legacy input still works: trailing base suffixes (101b, 35o, 212t), the
trailing-'h' hex form and the k/m/g scale suffixes are all accepted and
warn once, pointing at the 0b/0o/0t prefixes. doc/math.md documents the
language and doc/math-il-lift.md the lift; the grammar, the evaluator,
rz-ax and the % command are covered by unit and db tests.
2026-07-24 02:57:27 +08:00
..
nettle build: Improved meson-build to use rizin as subproject (#4684) 2024-10-29 23:59:42 +08:00
packagefiles Capstone eBPF disassembly (#6611) 2026-07-19 17:51:24 +08:00
ptrace-wrap Move remaining things from shlr/ to meson subprojects (#2126) 2021-12-22 09:20:39 +08:00
rizin-math-parser Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
rizin-shell-parser Regenerate shell parser 2026-06-21 01:09:02 +08:00
rzar subprojects/rzar: fix crash (#6516) 2026-06-17 02:09:11 +08:00
rzgdb Implement file download from the remote machine in GDB protocol (#6576) 2026-07-18 14:49:31 +08:00
rzheap Refactor windows heap parser (#6014) 2026-04-10 15:46:11 +08:00
rzqnx Fix unused-but-set-variable 2026-06-01 01:45:59 +08:00
rzspp librz/hash: add murmur3 hash function (without keys support) (#6002) 2026-03-25 15:46:37 +08:00
rzw32dbg_wrap Move remaining things from shlr/ to meson subprojects (#2126) 2021-12-22 09:20:39 +08:00
rzwinkd Fix Illumos/Solaris platform support (#5972) 2026-02-27 13:01:40 +08:00
xxhash build: Improved meson-build to use rizin as subproject (#4684) 2024-10-29 23:59:42 +08:00
yxml SPDX Copyright text for all files based on history 2021-03-05 19:39:15 +08:00
blake2.wrap blake2 hash support (#5995) 2026-03-06 22:17:59 +08:00
blake3.wrap subprojects: bump blake3 to 2de3cb1 (#5091) 2025-04-18 23:13:12 +08:00
capstone-next.wrap Update capstone-next and support Alpha instruction ID variants (#6621) 2026-07-17 00:53:43 +08:00
capstone-v4.wrap Use git depth 1 for Meson subprojects (#4138) 2024-01-22 21:14:32 +08:00
capstone-v5.wrap Use git depth 1 for Meson subprojects (#4138) 2024-01-22 21:14:32 +08:00
capstone-v6.wrap Update Capstone and add M68k ColdFire support (#6399) 2026-05-31 16:15:56 +08:00
libdemangle.wrap Bump rz-libdemangle (#6575) 2026-06-29 10:51:14 +08:00
liblzma.wrap subprojects: update xz to 5.8.3 2026-06-21 05:16:57 +08:00
libmspack.wrap Use git depth 1 for Meson subprojects (#4138) 2024-01-22 21:14:32 +08:00
libzip.wrap subprojects: update libzip 1.11.4 (#5701) 2025-12-30 05:29:39 +08:00
lz4.wrap subprojects: update lz4, xz, zstd libraries (#4958) 2025-03-04 02:44:53 +08:00
pcre2.wrap Updated to pcre2 10.47 (#5830) 2026-01-27 14:44:51 +00:00
pcre2_cross_native.wrap Updated to pcre2 10.47 (#5830) 2026-01-27 14:44:51 +00:00
rizin-grammar-c.wrap subprojects/rizin-grammar-c: update to tree-sitter-0.26.9 2026-06-21 01:09:02 +08:00
rizin-math-parser.wrap Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
sigdb.wrap Use git depth 1 for Meson subprojects (#4138) 2024-01-22 21:14:32 +08:00
softfloat.wrap Add wrap for native SoftFloat subproject 2024-09-04 21:16:17 +08:00
softfloat_cross_native.wrap Add wrap for native SoftFloat subproject 2024-09-04 21:16:17 +08:00
tree-sitter.wrap subprojects: update tree-sitter to v0.26.9 2026-06-21 01:09:02 +08:00
zlib.wrap subprojects: update zlib to 1.3.2 2026-06-21 05:16:57 +08:00
zstd.wrap subprojects: update lz4, xz, zstd libraries (#4958) 2025-03-04 02:44:53 +08:00
zydis.wrap Migrate from Capstone to Zydis (x86 architecture) (#5164) 2025-05-23 13:03:46 +00:00