fix(project-preparser): preserve note block content by jinchuntan · Pull Request #1080 · 8f4e/8f4e · GitHub
Skip to content

fix(project-preparser): preserve note block content - #1080

Merged
irimias57 merged 1 commit into
8f4e:mainfrom
jinchuntan:fix/note-block-content
Oct 17, 2026
Merged

irimias57 merged 1 commit into
8f4e:mainfrom
jinchuntan:fix/note-block-content

Conversation

@jinchuntan

Copy link
Copy Markdown
Contributor

Notes can now contain lines such as module declarations hold state and moduleEnd without being parsed as source structure. The parser keeps the note text until noteEnd and preserves its whitespace and source identity.

Added 20 parser regressions for root notes and nested groups. Missing terminators still report unclosed notes. Existing source block validation and parser snapshots pass.

Fixes #1062

All 414 tests pass across three compiler packages. Biome and the affected type checks also pass.

npx nx run-many --target=test \
  --projects=@8f4e/project-preparser,@8f4e/program-composer,@8f4e/compiler \
  --parallel=1 --output-style=static
npx biome check packages/compiler/packages/project-preparser/src/parseProjectSource.ts packages/compiler/packages/project-preparser/src/index.test.ts

The commit hook ran the affected type checks for both changed TypeScript files.

Prepared with Codex assistance. I reviewed the change and the test results.

Read notes as text until noteEnd so language block markers can appear
in their content. Preserve raw source lines and existing validation for
other document blocks.

Add root and nested note regressions and document the behavior.

Fixes 8f4e#1062
@andorthehood andorthehood added contributor compiler Compiler, tokenizer, codegen, and language-semantics work labels Oct 17, 2026

@irimias57 irimias57 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution, Nigel! The compiler-side change is well scoped, the new coverage is thorough, and the implementation correctly preserves note contents until the matching noteEnd. Nicely done!

@irimias57

Copy link
Copy Markdown
Member

@irimias57
irimias57 merged commit 5b75b1d into 8f4e:main Oct 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler Compiler, tokenizer, codegen, and language-semantics work contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow ordinary prose and code examples inside note blocks

3 participants