Audit nim-parser and tts-parser comments (#225 Phase 2) - #239
Merged
Conversation
Phase 2 for #225. Two binary-format parsers with near-symmetric comment shapes; 27 flagged comments total. Moved to JSDoc on the exported function where the doc belongs: - nim-parser: 8-line .blocks.nim format table, kept as reverse- engineered guess (typos also fixed). - tts-parser: TTS format spec URL folded into parseTts's JSDoc. Compressed to single-line INVARIANT: markers: - Both parsers: "try scope must contain only ByteReader reads so the finally releases the FD when reads throw." Compressed to two-sentence WHY: markers (period-split): - Both parsers: version/header validated after the body read to keep the code sequence mirroring the on-disk layout. Malformed inputs are rare because they come from the game's own exporter. Section markers // Header / // Block data in tts-parser deleted; the neighbouring reads speak for themselves. EXCLUDED_PATHS shrinks from 66 to 64.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2 for #225: audit
tools/lib/nim-parser.ts(16 comments) andtools/lib/tts-parser.ts(11 comments). Drop both fromEXCLUDED_PATHS.Both files are binary format parsers with near-identical comment shapes, so the treatment is symmetric.
Per-comment disposition
nim-parser.ts
parseNimparseNim. Kept the "reverse-engineered guess" caveat since it warns future editors that no upstream spec was consulted. Also fixed typosIts/refered/definisionsINVARIANT:about FD-release on read throwWHY:(period-split): layout-mirroring intent, then the "malformed files are rare" justificationtts-parser.ts
// TTS format: https://...parseTtswhere the format is actually parsedINVARIANT:// Header(21)// Block data(30)WHY:Style
Markers use single or double sentences with period, no
;/—/ colon-elaboration.Test plan
deno task ci:lintpassesdeno task ci:fmt-checkpassesdeno task ci:type-checkpassesdeno task test— 41 tests / 241 steps passProgress
EXCLUDED_PATHS: 66 → 64. Remainingtools/lib/files (5) queued for the next batch (ico.ts,prefab-files.ts,symbol-chars.ts,utils.ts—prefab-html.tsalready done in #238).