Repository navigation
Add the Sand language, language server, and Zed support - #507
ThatOneToast wants to merge 11 commits into
Conversation
Introduce `.sand` source files that compile through the portable program backend, so packs need neither Cargo nor sand.toml. - sand-lang: parser, analysis, execution-context inference, typed vanilla values, naming lints, and editor queries with position-aware completion - sand-lsp and `sand lsp`: diagnostics, hover, completion, signature help, navigation, and rename - `sand lang new|check|build|run|emit|zed`; `sand run` also accepts language projects - Portable model: arithmetic, control flow, text, entities and entity State, attributes, teleport, player events, custom items, recipes, and tags - Generated `sand::vanilla::ParticleType` and `Attribute` registries - tree-sitter grammar and Zed extension Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Add custom events, timers, world actions and conditions, boss bars, single-pool loot tables, and smithing upgrades to the Sand language and the portable program, with completion, hover, highlighting, and docs. Portable output now runs through the same final 26.3 resource-schema pass as Rust export, so packs targeting 26.3 emit predicates with `type` and load instead of failing registry parsing. Player loops keep Rust's contract of changing the executor only; event dispatch runs at the player, as Rust's does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the Sand language Calls that can re-enter their caller save the caller's locals, parameters, and temporaries on a command-storage stack (PushFrame/PopFrame) and restore them afterwards; other calls compile exactly as before. Self-calls and arguments that call functions are computed into temporaries before any parameter is written. Loops gain `for i in a..b` / `a..=b`, `loop`, `break`, and `continue` inside `while`; `while` accepts any condition. Functions returning bool can be used directly as conditions. The portable program gains DataGet for reading entity data such as health and food. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Player.health`, `Player.food`, and other entity data read as typed values; every attribute is a property that can be read and assigned, such as `Player.max_health = 40.0;` or `zombie.scale *= 2.0;`. Loop bindings act as handles for the entity they run as. get_attribute and set_attribute are removed in favour of properties. Editors complete properties after a handle, show their type and whether they are writable, and complete break, continue, loop, and counting for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`as` converts between number, float, bool, and enums with one rule shared by constants and run time, and explains impossible casts. Unary minus binds tighter than `as`, as in Rust. `emit Name(args);` replaces the emit builtin, handlers may ignore an event's payload, and the old spelling gets a fix-it message. Keyword hover covers loops, jumps, casts, and emit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…itter grammar Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…face The language guide covers counting for, loop, break and continue, any while condition, recursion and how frames are saved, the cast table, Player and loop-handle properties, and payload-free event handlers. API surface tests record the frame, entity-data, and EntityData method additions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
.sandfiles express gameplay and compile through the portable backend shared with Rust and JSON packs. Language projects need neither Cargo norsand.toml.Language and runtime
number, fixed-pointfloat,bool, enums), constants, modules, imports, and privacy.matchwith constant alternatives, loops, counting ranges,.rev(),.step_by(n), and loop jumps. Range bounds and runtime command arguments evaluate once in source order.Tools
sand lang new|check|build|run|emit|zed;sand runrecognizes language projects.sand fmtandsand lang fmt, including--check.The guide, parity table, and remaining expansion checklist are in
book/src/language.mdandROADMAP.md.Remaining scope
This PR does not yet deliver every requested language extension. Records, collections, runtime strings, first-class functions, methods/generics, suspended continuations (
wait), persistent entity references, broader resource/world APIs, language-authored tests/debugging, and the high-level Rust gameplay systems remain unfinished. Match currently supports statement arms rather than value expressions. Real Zed-session interaction remains unverified. Minecraft's numeric and command execution limits still apply.Validation
scripts/check.shandgit diff --checkpass.