tree-sitter-lmscript reference

Reference tables for tree-sitter-lmscript AST nodes, injection queries, companion parser rules, and test exit codes.

AST node and grammar surface

Node / ArtifactKindDescription
data_block_statementOuter AST nodeWraps a queued data block header, body (lmcode_body or data_body), and block_closer
block_markerOuter AST nodeHeader token such as _lmcode_ or _dsl_ with cli, install, or schema attributes
lmcode_bodyOuter AST nodeExact physical byte range of the inner lmcode chunk excluding header and end _lmcode_
data_bodyOuter AST nodeBody node for non-lmcode data blocks
block_closerOuter AST nodeClosing delimiter line such as end _lmcode_ or end _dsl_
lmscript_lmcode_bodyCompanion root nodeRoot node produced by the lmcode-body/ companion parser for injected lmcode_body ranges
queries/injections.scmQuery fileTree-sitter injection query binding lmcode_body to lmscript_lmcode
scripts/conformance.mjsVerification scriptRuns public corpus checks, failing controls, mutant gates, and optional --live scan

Standard REST and CLI interfaces recognized by the grammar

InterfaceCanonical declarationBehavior
RestGetinterface RestGet(exchange: RestExchange) -> voidHTTP GET endpoint bound by path annotation such as @"/users/:id"
RestPostinterface RestPost(exchange: RestExchange) -> voidHTTP POST endpoint bound by path annotation such as @"/users"
RestPutinterface RestPut(exchange: RestExchange) -> voidHTTP PUT endpoint bound by path annotation such as @"/users/:id"
RestDeleteinterface RestDelete(exchange: RestExchange) -> voidHTTP DELETE endpoint bound by path annotation such as @"/users/:id"
RestPatchinterface RestPatch(exchange: RestExchange) -> voidHTTP PATCH endpoint bound by path annotation such as @"/users/:id"
RestHeadinterface RestHead(exchange: RestExchange) -> voidHTTP HEAD endpoint bound by path annotation
RestOptionsinterface RestOptions(exchange: RestExchange) -> voidHTTP OPTIONS endpoint bound by path annotation
RestHandlerinterface RestHandler(exchange: RestExchange) -> voidMethod-prefixed (@"POST /users") or rest_route(method, path, annotation) handler
CliCommandinterface CliCommand(exchange: RestExchange) -> voidStateless CLI subcommand entry dispatched by rest_cli(args)
CliOptioninterface CliOption(exchange: RestExchange) -> voidStateless CLI flag or option entry dispatched before CliCommand by rest_cli(args)

Verification exit statuses

Exit codeStageResultCondition
0parse / testExit 0Grammar generation, the generated-file freshness check and the corpus conformance cases all pass
1conformanceExit 1A corpus conformance case fails; the failing case is printed with a FAIL prefix
1freshnessExit 1Generated src/parser.c, grammar.json, or node-types.json differs from grammar.js after tree-sitter generate