How thatonetoast/sand works
Main Components
a) Input Processing Layer:
• Tree-sitter Parser (from tree-sitter-sand directory)
• Grammar definitions (grammar.js)
• Source file handling (.sand files)
• Configuration handling (Sand.toml)
b) Language Processing Layer:
• Language Handles (/src/lang/handles)
• Structure definitions (/src/lang/structure.rs)
• Execute handlers (execute_h.rs)
c) Datapack Generation Layer:
• Datapack Builder (/src/datapack/builder)
• Minecraft-specific components:
• Advancements (advancements.rs)
• Enchantments (enchantments.rs)
• Entities (mc_entities.rs)
Flow and Relationships
[Input Files (.sand, .toml)] → [Tree-sitter Parser] → [AST]
• ↓
[Language Processing Layer] ← → [Structure Definitions]
• ↓
[Datapack Builder] → [Minecraft Datapack Components]
• ↓
[Output: Generated Datapack]
Important Details to Highlight
a) Parser Pipeline:
• How the tree-sitter grammar feeds into the parsing process
• Transformation from Sand syntax to Minecraft commands
b) Language Features:
• Function handling (as shown in the example code)
• Command translation process
• Effect command processing
c) Build Process:
• Build.rs integration
• Test framework connection
Additional Elements
• Version information
• Notes about development status
• Extension points for future features