feat(types): IVec2 + Rect 2D value types (#1)
Phase 1 of the fuller type-system proposal: two by-value spatial types that lower to packed integers (no heap, copy like scalars). - IVec2 — integer 2D vector, a pair of int packed into one i64, for tile and grid coordinates: make/zero/x/y/add/sub/scale/dot, the grid distance manhattan, equal, and to_vector (widen into the fixed-point Vector). - Rect — axis-aligned rectangle, four Q16.16 fixed components packed into one i128, for HUD boxes and hitboxes: make/x/y/w/h, the derived right/bottom/center, and the contains (point) / intersects (overlap) tests. Both are exact and deterministic, bit-identical on every platform. Vector and Color already cover phase 1's other 2D primitives. Wired end to end: emit_core llty (IVec2->i64, Rect->i128), emit_call dispatch, the FRAGS list + reseeded seed, a selfhost test (types2d), per-symbol docs + type pages + inventory, and the vocabulary/editor sync (header, JetBrains, TextMate, LSP). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
3df6640fa5
commit
2c9f9ac549
40 changed files with 26731 additions and 24058 deletions
|
|
@ -96,6 +96,7 @@ function cmd_selfhost_test() -> int {
|
|||
sh_case("math3", "45 90 180 -135 30 60 90")
|
||||
sh_case("transcend", "2718 1 148 1000 0 2303 1024 1414 3 250 0 1000 1016")
|
||||
sh_case("vector", "3 4 5 4 6 2 2 11 2 6 999 999 999 1570 5 10")
|
||||
sh_case("types2d", "3 4 4 6 2 2 9 12 11 4 0 1 0 4 10 20 30 40 40 60 25 40 1 0 0 1 0")
|
||||
sh_case("datetime", "10800 330 172800 3 2 0 10957 2026 8 30 4 6 1 0 1 29 28 31 2 1 365 946729815 2000 1 1 12 30 15 6 10957 1")
|
||||
sh_case("datetime2", "2026-08-30 07:05:09 30/08/26 0 -1 3600 5400 30 0")
|
||||
sh_case("textsplit", "1 1 1 3 1 1 1 1 1 1 1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue