master
<comment> had no special-case in jetc's compiler at all - it fell through to parseFallback(), the generic unknown-tag path, which hunts for a tag's own closing tag via scanBody()/skipQuotedValue(), the same quote-aware, backslash-escape-interpreting scanning real Jet attribute syntax needs. A comment containing an explanatory " sequence (a JSON example in prose, say) or a literal <else>/<if>-looking word - both already confirmed, separately, to corrupt jetc when they turn up inside a JS // comment - hit the exact same corruption here too, just triggered from inside a <comment> block instead. Added skipCommentTag(), which only tracks same-tag-name nesting depth via the existing case-insensitive matchTagOpen/matchTagClose and otherwise ignores every character - no quote tracking, no other-tag recognition, nothing a comment's own body could ever trip over. Wired into parseNodes() alongside the other recognized top-level tags; unlike those, it pushes no node at all; the comment contributes nothing to the compiled output, matching the runtime interpreters own __comment behavior but now safe at compile time too. Verified directly: a scratch .jet with five <comment> blocks (plain, a bare quote, a backslash-quote JSON example, literal <else>/<if> text, and nested comments with their own quotes) all compiled clean and left zero trace in the generated code, with the <if> immediately following them compiling correctly too - confirming nothing after a tricky comment gets corrupted either. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Languages
HTML
50.2%
TeX
18.7%
C++
15%
JavaScript
7.5%
CSS
4.4%
Other
4.2%