2.8 KiB
2.8 KiB
| id | ticket | title | status | created | ref_decisions | tags | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0093 | pbs-symbol-documentation-and-hover-markdown | Implement PBS lexer support for documentation text blocks | done | 2026-07-15 |
|
|
Briefing
Add lexical support for triple-quoted documentation text blocks required by [Doc(markdown = """...""")].
Objective
Teach the PBS lexer to tokenize documentation text blocks without turning triple quotes into a general runtime string feature.
Dependencies
- Depends on
PLN-0092for the normative syntax.
Scope
- Add a dedicated token kind for documentation text block payloads or an equivalent lexer representation.
- Recognize
"""open and close delimiters. - Preserve source text and spans for parser and diagnostics.
- Report unterminated documentation text blocks with useful span information.
Non-Goals
- Parse or validate
[Doc]attribute shapes. - Normalize indentation.
- Lower documentation to runtime artifacts.
- Add general multiline string expressions.
Execution Method
- Update
prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/lexer/PbsTokenKind.javawith a documentation text block token if a distinct token is the cleanest local pattern. - Update
prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/lexer/PbsLexer.javato recognize"""..."""and preserve its raw lexeme and span. - Ensure ordinary string scanning remains unchanged for
"...". - Add or update lexer diagnostics in
LexErrors.javaonly if existing unterminated-string diagnostics cannot accurately represent unterminated documentation text blocks. - Add focused tests in
PbsLexerTestfor valid text blocks, multiline payloads, embedded single quotes/double quotes, and unterminated blocks.
Acceptance Criteria
- The lexer can tokenize a multiline documentation text block.
- Unterminated documentation text blocks produce a deterministic diagnostic.
- Ordinary string literals keep current behavior.
"""..."""is not accepted as an expression-level runtime string by this plan.
Tests
./gradlew :prometeu-compiler:frontends:prometeu-frontend-pbs:testor the repository-equivalent targeted compiler frontend test task.- Focused
PbsLexerTestcases for documentation text blocks.
Affected Artifacts
prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/lexer/PbsLexer.javaprometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/lexer/PbsTokenKind.javaprometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/lexer/LexErrors.javaprometeu-compiler/frontends/prometeu-frontend-pbs/src/test/java/p/studio/compiler/pbs/lexer/PbsLexerTest.java