Idea detail
fencing_comments
reqlan rq/language/syntax-edge-cases.rq:35
block
done
Summary
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: comments, inline_code, naked_strings_in_body, comment_span_align.
Navigation
Attributes
| Key | Value |
|---|---|
| implementation | reqlan-line-fences.ts, reqlan-token-builder.ts, reqlan-comment-resolver.ts, patch-textmate.mjs, reqlan.tmLanguage.json, lexer.rs, rq_ignore.rs |
| status | done |
| tests | parsing.test.ts:parse syntax-edge-cases.rq, comment-in-string.test.ts:isInsideLineFence treats only complete same-line fences as fences, this line in block body is not a line comment, this line in block body is not a line comment, is a line comment, is a line comment, inside complete backtick fences when locating line comments, references.test.ts:findCommentSpansInText treats unclosed fences as comments and closed fences as prose, * inside complete backtick fences, * in block body is not a block comment, * is not a block comment, langium-rust-parse-align.test.ts:fencing_comments, lexer.rs:backticked_slash_star_is_not_a_comment, lexer.rs:quoted_slash_slash_in_body_is_not_a_comment, lexer.rs:backticked_slash_slash_in_body_is_not_a_comment, lexer.rs:unclosed_backtick_then_slash_slash_is_a_comment, lexer.rs:unclosed_quote_then_slash_slash_is_a_comment, rq_ignore.rs:does_not_treat_marker_inside_backticks_as_a_directive |
Ancestor context
No ancestor chain recorded.
Outbound references
Inbound references
| Kind | Idea | Path | Snippet |
|---|---|---|---|
| references | comment_span_align | reqlan rq/core_analysis/rust_port.rq | fencing_comments |
| references | comments | reqlan rq/language/syntax.rq | fencing_comments |
Unresolved references
| Kind | Idea | Path | Snippet |
|---|---|---|---|
| None | |||
Local graph
Initialising graph…