Repository navigation
Conversation
Strip inline // comment tails outside strings so one trailing note no longer empties the menu, reject array roots that became phantom "0"/"1" rows, and keep commas inside string labels while stripping trailing ones. Co-authored-by: AnPod <AnPod@users.noreply.github.com>
684b724 to
6acbace
Compare
|
Thanks @AnPod. I read this against The array-root guard and the string-aware handling of {
"a": {"label": "A"},
// note
}That is the shape of the shipped #13968 fixes the same three issues (#13250, #13492, #13493) the same way. Its comma lookahead also skips This is now waiting on the maintainer to choose between this pull request and #13968. If they would rather take this one, the change it needs is #13968's lookahead, which skips |
… input-domain SW-REQ-261001-BNZG - SW-REQ-260927-66FW: next_char_closes_json is now "the next character that is neither whitespace nor part of a // comment is } or ]", so the requirement no longer encodes the next-non-whitespace rule that omacom#13512/omacom#13681 shipped. - SW-REQ-260928-BMFE (array root) and SW-REQ-260928-C8W1 (comments, line break kept) re-applied from e797ba5 onto the PR code. - SW-REQ-261001-BNZG (new): the stripper's input domain - any JS \s character outside strings is whitespace (line feed kept, others become one ASCII space), a leading BOM is accepted, strings are verbatim. malformed_input with required nominal/negative/differential evidence. - E4J2/3T3F/PPDW prose and hazard rationale moved from the two regex passes to the PR scanner; DEFECT-260927-CMMA/-260928-4NG9/-260928-7AX9 and REVIEW-21/72/73 re-pointed to the PR; REVIEW-261001-ENZ2 (BNZG). - Implements annotations on stripJsonc/parseMenuJsonc; independence re-verified (59 guarantees). The 129 menu variables fit the budget of 130 that the baseline now sets (quattro-proof 4f1a819). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… input-domain SW-REQ-261001-BNZG - SW-REQ-260927-66FW: next_char_closes_json is now "the next character that is neither whitespace nor part of a // comment is } or ]", so the requirement no longer encodes the next-non-whitespace rule that omacom#13512/omacom#13681 shipped. - SW-REQ-260928-BMFE (array root) and SW-REQ-260928-C8W1 (comments, line break kept) re-applied from e797ba5 onto the PR code. - SW-REQ-261001-BNZG (new): the stripper's input domain - any JS \s character outside strings is whitespace (line feed kept, others become one ASCII space), a leading BOM is accepted, strings are verbatim. malformed_input with required nominal/negative/differential evidence. - E4J2/3T3F/PPDW prose and hazard rationale moved from the two regex passes to the PR scanner; DEFECT-260927-CMMA/-260928-4NG9/-260928-7AX9 and REVIEW-21/72/73 re-pointed to the PR; REVIEW-261001-ENZ2 (BNZG). - Implements annotations on stripJsonc/parseMenuJsonc; independence re-verified (59 guarantees). The 129 menu variables fit the budget of 130 that the baseline now sets (quattro-proof 4f1a819). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Summary
//comment tails outside strings so one trailing note no longer empties the whole menu"0","1", …, ]or, }are silently corrupted by the trailing-comma stripper #13250)docs/menu.mdto match the new JSONC rulesTest plan
bash test/shell.d/menu-test.sh//comment tail silently empties every entry in that menu file #13493 / Menu JSONC: a top-level array root is silently read as menu rows with ids "0", "1", … #13492 returns the expected rows /[]Note: AnPod #30 rewrites the same
stripJsoncfor string commas only; this PR is the one that closes #13493/#13492 and includes those regressions.