Expand description
Scoped settings { ... } extraction and JSONC parsing (#86).
The settings block is recognized and consumed before lexing, so the
lexer never gains global {/} tokens (meipocalypse’s dict literal keeps
failing as a lex-error). find_blocks locates a top-of-file block
with a logical-line keyword scan, sanitize_for_lex blanks the block
region out of the text handed to the lexer (newlines preserved, so
positions after the block are unchanged), and parse_block turns the
JSONC text into a typed cst::Settings tree with source spans.
The parse is value-driven: any JSONC object/leaf shape becomes a
structurally generic cst::SettingsNode. Which keys exist and which
leaf kinds/spellings are valid is Workshop-owned settings-schema content;
that validation is lowering-dependent (issue #8) and lives at the
Workshop integration boundary, never in a local allowlist here.
Structs§
- Settings
Block - A top-of-file
settings { ... }block.
Functions§
- find_
blocks - Locate every
settings { ... }block in a source text. - parse_
block - Parse a settings block’s JSONC text into a typed CST settings tree.
- sanitize_
for_ lex - Replace every char of the block region with a space, preserving newlines, so tokens after the block keep their exact original line/col.