| Crates.io | oxdock-parser |
| lib.rs | oxdock-parser |
| version | 0.6.0-alpha |
| created_at | 2025-12-18 21:46:46.302829+00 |
| updated_at | 2025-12-25 17:46:04.927136+00 |
| description | Parser and AST definitions for the OxDock DSL. |
| homepage | |
| repository | https://github.com/jzombie/oxdock-rs |
| max_upload_size | |
| id | 1993601 |
| size | 122,779 |
oxdock-parser builds the executable steps for the OxDock DSL that powers the
CLI and the embedding macros. The DSL is intentionally compact, but it now has
an explicit grammar so that other tooling (formatters, language servers, IDE
plugins, etc.) can understand scripts without re‑implementing the parser.
The grammar lives in src/dsl.pest and is consumed directly by
the lexer. A copy of the grammar is also exposed at runtime via the
oxdock_parser::LANGUAGE_SPEC constant so that downstream tools can embed or
inspect the canonical definition without reaching into the crate filesystem.
use oxdock_parser::LANGUAGE_SPEC;
fn dump_grammar() {
println!("OxDock DSL grammar:\\n{}", LANGUAGE_SPEC);
}
Because the parser is generated from this same file, the “spec” and the implementation stay in lockstep—the language is exactly what the grammar describes.
pest) tokenizes scripts
according to dsl.pest, handling comments and semicolons along the way.ScriptParser, which performs guard stack
combination, scope tracking, and StepKind construction (no language
behaviour changed from the previous hand-written line parser).Vec<Step> is consumed by runtimes (CLI, macros, tests, etc.).All existing semantics—including guard combinations, case sensitivity, semicolon behaviour, and error messages—remain the same, but they are now enforced through the shared grammar file.