Code reference detail
parsing.test.ts:treats fenced TypeScript braces as opaque for surrounding structure
packages/language/test/parsing.test.ts:treats fenced TypeScript braces as opaque for surrounding structure
| Idea | Status | Tags | Summary |
|---|---|---|---|
| context_sensitive_lexer_scaling | done | Context-sensitive token classification for structural / prose braces and top-level import keywords must remain linear in document size. The lexer records brace-depth changes sparsely ( not per-character tables ) and looks them up in log time while tokenising, so workspace language-server initialization and editor re-lexes stay bounded. Code fences are skipped during the brace scan so example braces cannot inflate work or desync depth. Bounded work still assumes the lexer / parser * returns *; unbounded hangs are cut by ["./parser_lexer.rq".parse_budget_timeout]. | |
| nested_curly_braces | if there is a prose block containing curly braces, { such as this one } they should be treated as part of the prose. Matching braces that end a line — including adjacent pairs like { { SITE_URL } } — stay in the body; they must not close the enclosing idea. A lone `}` on its own line still closes the structural block so an unbalanced prose `{` cannot swallow the idea closer. | ||
| code_snippets | Idea bodies and block attribute values may embed fenced code blocks delimited by triple backticks. An opening fence is three backticks on a line, optionally followed by a language tag such as python or rq. A closing fence is three backticks on a line. Everything between the fences is literal opaque text — it is not parsed as reqlan syntax. Keywords, imports, attributes, braces, and quotes inside a fence are inert for the parser and may be shown as examples without parse errors. Fenced blocks may span multiple lines and preserve their inner content verbatim. Brace-depth tracking must skip fence interiors so example braces cannot desync surrounding structure ( [no_name_idea_safe_warning] ). | ||
| file_suffix | Reqlan requirement documents use the . rq file suffix . | ||
| no_name_idea_safe_warning | done | A top-level nameless curly-brace block — `{... }` with no idea name — must not take down the parser or the language server workspace. Parse the block as a recoverable anonymous top-level element, emit a descriptive warning that a name is required before `{`, and continue so later ideas, imports, and links still work. Nameless blocks inside parenthesized lists remain valid list items per [lists]; only top-level nameless blocks warn. Related recovery posture: ["./imports.rq".import_error_recovery]. Block shape: [block_idea]. Fenced examples must stay opaque per [code_snippets] so braces inside snippets cannot desync structural depth. Non-termination ( lex / parse never finishes ) is a different failure mode: ["./parser_lexer.rq".parse_budget_timeout]. |
Reference labels
../../packages/language/test/parsing.test.ts:treats fenced TypeScript braces as opaque for surrounding structure