Code reference detail
lexer.rs
crates/reqlan-parse/tests/lexer.rs
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| analytical_rust_port | in-progress | Port ["../core-architecture.rq".analytical_package] to Rust: lexer, parser ( index path ), extractor, SQLite index, search, and export. `@reqlan/analytical` remains the published JS facade ( `createAnalysisRuntime` / `AnalysisApi` / Zustand host state ). Native work lives in a `crates/` Cargo workspace and ships as per-architecture binaries per [distribution.rust_binary_distribution]. The editor language server is [lsp_rust.language_server_rust]. This analytical port does not replace that process. Component plans: [rust_crate_layout], [lexer_rust], [parser_rust], [parser_align], [indexer.indexer_rust], [search_rust], [export_rust], [native_bridge], [cutover]. | 0.243 | |
| comment_span_align | done | On every frozen [golden_corpus] `.rq` file, `//` and `/* … */` comment character ranges must be identical across: - the Langium lexer ( hidden `SL_COMMENT` / `ML_COMMENT` ) - `findCommentSpansInText` C-style spans ( host `#` / triple-quote spans are not `.rq` comments ) - TextMate `comment.line.reqlan` and `comment.block.reqlan` scopes Same-line fences, glob `/**/`, URL `://`, and fenced ` ` ` bodies must not open comments. Mid-line triple backticks are prose. They must not open a fence or hide later ideas. Example: `@reqlan/*` in inline code must not open a block comment. Related: [parser_align], ["../language/syntax.rq".code_snippets], ["../language/syntax.rq".comments], ["../language/syntax-edge-cases.rq".fencing_comments], ["../language/syntax.rq".inline_code]. | 0.141 | |
| lexer_rust | done | Hand-written Rust lexer that ports ["../../packages/language/src/reqlan-token-builder.ts"]: structural vs prose `{` / `}`, fence opacity, quote-aware comments, `@` only at line start, glob `/**/` not a block comment. Linear in document size with sparse brace-depth lookup ( [syntax_edges.context_sensitive_lexer_scaling] ). Owned by `reqlan-parse`; consumed by [parser_rust] and by [lsp_rust.language_server_rust]. The Langium token builder remains only for the transitional `node` engine fallback and dual-parser tests. | 0.105 | |
| parser_rust | done | Recursive-descent parser matching ["../../packages/language/src/reqlan.langium"] productions into a Rust AST the extractor can walk. Recovery: nameless `{...}` and local import mistakes still yield a usable document ( [parser_lexer.recovery_vs_budget] ). Wall-clock [parser_lexer.parse_budget_timeout] via native timeout / cancel — no Node worker process required on the index path. Open `.rq` buffers and CLI `parse` use `reqlan-parse` ( [lsp_rust.language_server_rust] ). Langium remains a dual-parser test oracle and the transitional `node` engine fallback — not the default editor LSP. Alignment contract: [parser_align]. | 0.217 | |
| fencing_comments | done | A complete same-line fence keeps `//` and `/*` as prose, not comments. Closed double quotes: " / / this line " contains no comment. Closed backticks: `//this line` contains no comment. Closed backticks with a glob: `@reqlan/*` does not open a block comment. An unclosed backtick is not a fence, so this line ` An unclosed quote is not a fence, so as does " The Langium lexer, the Rust lexer, comment scanners, and TextMate must use this rule. Related: ["./syntax.rq".comments], ["./syntax.rq".inline_code], ["./syntax.rq".naked_strings_in_body], ["../core_analysis/rust_port.rq".comment_span_align]. | 0.078 | |
| 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. | 0.108 | ||
| attribute_location | Marked attributes must be at the start of a line. @ this_is_not_an_attribute | 0.049 | ||
| attribute_namespacing | done | A bracket link `[idea.attribute]` targets one attribute of that idea. The first name is the idea name. The second name is the attribute name. The grammar types that name as an attribute or an idea declaration. `[attribute_namespacing.example]` targets the `example` attribute of this idea. The form `[ideaset.member]` still targets an ideaset member. See [references_to_subidea]. The editor opens the attribute when the first name is an idea. The editor reports an error when that idea has no attribute with the second name. The link target is only that attribute on that idea. HTML export uses the same link form. The export link opens that attribute on the idea page. See [attribute_namespacing.example]. Related: [reference_brackets], [attribute_marker], ["../core_analysis/html_export.rq".html_export_internal_links]. | 0.129 | |
| code_snippets | Idea bodies and block attribute values may embed fenced code blocks delimited by triple backticks. An opening fence is three backticks as the first non-whitespace characters on a line, optionally followed by a language tag such as python or rq. A closing fence is three backticks as the first non-whitespace characters on a line. Three backticks in the middle of a line are prose. They do not open a fence. 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] ). Related: ["../core_analysis/rust_port.rq".comment_span_align]. | 0.113 | ||
| comments | done | Line comments use `//` through end of line ( hidden `SL_COMMENT` ). Block comments use `/* … */` and may span multiple lines ( hidden `ML_COMMENT` ). Meta comments on the same line after content are allowed ( `keep this // meta` ). Comments must not open inside a string / reference-string context: - Naked body quotes ( ["naked_strings_in_body"] ): a quoted slash-slash that is not a comment, quoted urls, `"../mod/**/*.rq"`. - Reference / import `STRING` paths ( `["…"]`, `from "…" import …` ) — the lexer consumes the whole quoted path as one `STRING`, so neither `//` nor `/*` inside the quotes starts a comment. Example: a file reference whose path text contains slash-slash, `["../extension/**/*.rq".*webview*]`. - URL / path-segment guard: `//` immediately after `:` or `/` is not a line comment. Same-line fences: ["./syntax-edge-cases.rq".fencing_comments] — complete `"…"`, `'…'`, and ` ` ` … ` ` ` spans keep ` Unclosed quote or backtick openers are not fences, so `//` after them is a comment. Comment-range identity across lexer, scanner, and TextMate: ["../core_analysis/rust_port.rq".comment_span_align]. Multiline / glob clash: the empty block form `/**/` is **not** a comment — it is the recursive glob segment used in paths such as `../mod/**/*.rq`. A real block comment needs a non-empty body ( `/* note */`, `/*\n note\n*/` ). The token builder rejects length-4 `/**/` matches; comment-span scanners skip the same sequence so embedded `rq:[…]` discovery stays aligned. Related: [comment_reference_ignore], [string_literals], ["./imports.rq".wildcard_references], ["../core_analysis/rust_port.rq".comment_span_align]. | 0.145 | |
| empty_attribute | A line that contains only @ is insignificant whitespace. Spaces or tabs may precede that @. Spaces or tabs may follow that @. The lexer consumes that @ as hidden whitespace. The parser does not build an attribute for that line. That line does not cause a parser error. That line does not cause a lexer error. That line does not cause a tokenizer error. That line does not cause an extension error. A flag keeps the form @ name. A negated flag keeps the form @ name!. A valued attribute keeps its value after the name. A syntax error on a different line is still reported. | 0.040 | ||
| file_suffix | Reqlan requirement documents use the. rq file suffix. | 0.052 | ||
| inline_code | done | Single-backtick spans ( `…` ) are opaque `INLINE_CODE`. They may show example syntax such as a quoted path plus idea. The grammar does not parse bracket or file references inside the span. Check and the language server must not report those examples as unresolved ["../reference_types.rq".file_reference] or idea refs. Related: [code_snippets], ["../core_analysis/rust_port.rq".comment_span_align]. | 0.165 | |
| naked_strings_in_body | Quoted text in idea bodies, attribute values, and list items is plain prose, not a string literal. Quote characters are preserved in the body text. For example, " Fit to view " in a bullet line is body text. String literals are reserved for import paths, top-level quoted idea names, and quoted paths inside bracket references. Quoted path-like body text is not a ["../reference_types.rq".file_reference]: ["../reference_types.rq".reference_edgecase]. | 0.065 | ||
| reference_url | done | A bracket reference may target an unquoted absolute URL ( `scheme://…` ). Example: `[https://reqlan.com/]`. The URL is one token; `://` is not a line comment. Unbracketed URLs in body prose stay text. Quoted remote paths stay [reference_file] ( `["https://example.com/file.ts"]` ). Index and check: ["../reference_types.rq".url_reference]. | 0.137 | |
| idea_reference | done | Idea-to-idea ["./ontology.rq".reference]: bracket `[name]` / `[ideaset.name]` targets a local, imported, or same-file idea. Syntax: ["./language/syntax.rq".reference_brackets], ["./language/syntax.rq".same_file_reference], ["./language/syntax.rq".reference_qualified], ["./language/syntax.rq".reference_embedding], ["./language/syntax.rq".references_to_subidea]. Index edge kind `references` on [analytical_types] / [rust_index_types]. Extract: [idea_extractor], [rust_extract]. A `[ideaset.member]` form records the edge on the member leaf, not on the ideaset container. An attribute uses the same brackets. See ["./language/syntax.rq".attribute_namespacing]. Wikilink surface for the same edge kind: [link_reference]. Fan-out across files: [wildcard_reference]. | 0.125 | |
| reference_edgecase | done | A quoted string is a [file_reference] only when it is inside brackets. Example of a file reference: ["./reference_types.rq"] Example of body text: " this is not a reference. rq " The file suffix does not change this rule. The parser must not make a file reference from quoted body text. The language server must not make a document link or a missing-file error from quoted body text. Related: [file_reference], ["./language/syntax.rq".naked_strings_in_body], ["./language/syntax.rq".reference_file]. | 0.112 | |
| url_reference | done | A bracket reference whose target is an absolute URL with a scheme and `://`. Example: [https://reqlan.com/]. Syntax: ["./language/syntax.rq".reference_url]. Index edge kind `url_reference` on [analytical_types] / [rust_index_types]. Extract: [idea_extractor], [rust_extract]. [check] does not treat a URL reference as a missing idea or a missing file. Unbracketed URLs in body prose stay text, not this kind. Related: [file_reference], [link_reference]. | 0.075 |
Reference labels
"../../crates/reqlan-parse/tests/lexer.rs:at_only_at_line_start", "../../crates/reqlan-parse/tests/lexer.rs:backticked_bracketed_file_ref_is_one_inline_code_token", "../../crates/reqlan-parse/tests/lexer.rs:backticked_slash_slash_in_body_is_not_a_comment", "../../crates/reqlan-parse/tests/lexer.rs:backticked_slash_star_is_not_a_comment", "../../crates/reqlan-parse/tests/lexer.rs:bracket_attribute_link_lexes_a_dot_between_two_names", "../../crates/reqlan-parse/tests/lexer.rs:bracketed_url_is_one_url_token", "../../crates/reqlan-parse/tests/lexer.rs:glob_star_star_is_not_a_block_comment", "../../crates/reqlan-parse/tests/lexer.rs:line_start_triple_backticks_are_a_code_fence", "../../crates/reqlan-parse/tests/lexer.rs:lone_at_is_hidden_whitespace", "../../crates/reqlan-parse/tests/lexer.rs:meta_line_comment_after_content_is_hidden", "../../crates/reqlan-parse/tests/lexer.rs:mid_line_at_plan_brace_stays_prose", "../../crates/reqlan-parse/tests/lexer.rs:mid_line_triple_backticks_are_not_a_code_fence", "../../crates/reqlan-parse/tests/lexer.rs:middle_dot_before_brace_does_not_panic", "../../crates/reqlan-parse/tests/lexer.rs:prose_braces_stay_other", "../../crates/reqlan-parse/tests/lexer.rs:quoted_slash_slash_in_body_is_not_a_comment", "../../crates/reqlan-parse/tests/lexer.rs:structural_braces_around_named_block", "../../crates/reqlan-parse/tests/lexer.rs:unbracketed_quoted_path_in_body_is_not_string", "../../crates/reqlan-parse/tests/lexer.rs:unclosed_backtick_then_slash_slash_is_a_comment", "../../crates/reqlan-parse/tests/lexer.rs:unclosed_quote_then_slash_slash_is_a_comment", "../../crates/reqlan-parse/tests/lexer.rs:url_slashes_are_not_line_comments", "../crates/reqlan-parse/tests/lexer.rs:bracketed_url_is_one_url_token", "../crates/reqlan-parse/tests/lexer.rs:unbracketed_quoted_path_in_body_is_not_string", ../../crates/reqlan-parse/tests/lexer.rs:at_only_at_line_start, ../../crates/reqlan-parse/tests/lexer.rs:backticked_bracketed_file_ref_is_one_inline_code_token, ../../crates/reqlan-parse/tests/lexer.rs:backticked_slash_slash_in_body_is_not_a_comment, ../../crates/reqlan-parse/tests/lexer.rs:backticked_slash_star_is_not_a_comment, ../../crates/reqlan-parse/tests/lexer.rs:bracket_attribute_link_lexes_a_dot_between_two_names, ../../crates/reqlan-parse/tests/lexer.rs:bracketed_url_is_one_url_token, ../../crates/reqlan-parse/tests/lexer.rs:glob_star_star_is_not_a_block_comment, ../../crates/reqlan-parse/tests/lexer.rs:line_start_triple_backticks_are_a_code_fence, ../../crates/reqlan-parse/tests/lexer.rs:lone_at_is_hidden_whitespace, ../../crates/reqlan-parse/tests/lexer.rs:meta_line_comment_after_content_is_hidden, ../../crates/reqlan-parse/tests/lexer.rs:mid_line_at_plan_brace_stays_prose, ../../crates/reqlan-parse/tests/lexer.rs:mid_line_triple_backticks_are_not_a_code_fence, ../../crates/reqlan-parse/tests/lexer.rs:middle_dot_before_brace_does_not_panic, ../../crates/reqlan-parse/tests/lexer.rs:prose_braces_stay_other, ../../crates/reqlan-parse/tests/lexer.rs:quoted_slash_slash_in_body_is_not_a_comment, ../../crates/reqlan-parse/tests/lexer.rs:structural_braces_around_named_block, ../../crates/reqlan-parse/tests/lexer.rs:unbracketed_quoted_path_in_body_is_not_string, ../../crates/reqlan-parse/tests/lexer.rs:unclosed_backtick_then_slash_slash_is_a_comment, ../../crates/reqlan-parse/tests/lexer.rs:unclosed_quote_then_slash_slash_is_a_comment, ../../crates/reqlan-parse/tests/lexer.rs:url_slashes_are_not_line_comments, ../crates/reqlan-parse/tests/lexer.rs:bracketed_url_is_one_url_token, ../crates/reqlan-parse/tests/lexer.rs:unbracketed_quoted_path_in_body_is_not_string