refactor(lang): rename the ptr/ptrs types to pointer/pointers
Expand the abbreviated pointer types to full words on the language surface: ptr -> pointer (a raw address / FFI handle) ptrs -> pointers (a buffer of pointers) The Ludic type name is distinct from LLVM's own `ptr` spelling: llty() maps `pointer`/`pointers` to LLVM `ptr`, and the emitted IR keeps `ptr`, so only the Ludic-level surface changes. Rewrites type annotations across all sources, the 8 hardcoded pointer type-tags, the `pointers`-buffer indexing in emit_addr, the grammars/LSP/JetBrains tokens, and the docs (type-ptr -> type-pointer, type-ptrs -> type-pointers). int/bool keep their conventional short spelling (like Math). Reseeded; C-free fixpoint holds; all suites green (45/24/29); site + check.py OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
b7745a4600
commit
effb3f637f
76 changed files with 516 additions and 516 deletions
|
|
@ -3,14 +3,14 @@
|
|||
# origin at the top-left; circles are (x, y, r). Squared distances use i64 so a
|
||||
# large coordinate can't overflow. Each returns a bool.
|
||||
|
||||
function is_collide_ns(meth: ptr) -> bool {
|
||||
function is_collide_ns(meth: pointer) -> bool {
|
||||
if (meth == "rects") or (meth == "point_rect") { return true }
|
||||
if (meth == "circles") or (meth == "rect_circle") { return true }
|
||||
return false
|
||||
}
|
||||
|
||||
# dx*dx + dy*dy widened to i64 (no overflow for 32-bit deltas)
|
||||
function coll_sq_sum(dx: ptr, dy: ptr) -> ptr {
|
||||
function coll_sq_sum(dx: pointer, dy: pointer) -> pointer {
|
||||
let dx64 = emit_bind(`sext i32 {dx} to i64`)
|
||||
let dy64 = emit_bind(`sext i32 {dy} to i64`)
|
||||
let xx = emit_bind(`mul i64 {dx64}, {dx64}`)
|
||||
|
|
@ -19,14 +19,14 @@ function coll_sq_sum(dx: ptr, dy: ptr) -> ptr {
|
|||
}
|
||||
|
||||
# max(lo, min(v, hi)) — clamp v into [lo, hi]
|
||||
function coll_clamp(v: ptr, lo: ptr, hi: ptr) -> ptr {
|
||||
function coll_clamp(v: pointer, lo: pointer, hi: pointer) -> pointer {
|
||||
let c1 = emit_bind(`icmp slt i32 {v}, {hi}`)
|
||||
let t = emit_bind(`select i1 {c1}, i32 {v}, i32 {hi}`)
|
||||
let c2 = emit_bind(`icmp sgt i32 {lo}, {t}`)
|
||||
return emit_bind(`select i1 {c2}, i32 {lo}, i32 {t}`)
|
||||
}
|
||||
|
||||
function emit_collide_ns(meth: ptr, e: Node) -> Val {
|
||||
function emit_collide_ns(meth: pointer, e: Node) -> Val {
|
||||
if (meth == "rects") { # AABB overlap of two rects
|
||||
let ax = emit_expr(e.kids[0]); let ay = emit_expr(e.kids[1]); let aw = emit_expr(e.kids[2]); let ah = emit_expr(e.kids[3])
|
||||
let bx = emit_expr(e.kids[4]); let by = emit_expr(e.kids[5]); let bw = emit_expr(e.kids[6]); let bh = emit_expr(e.kids[7])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue