Skip to content

v0.25.4

@DavidBakerEffendi DavidBakerEffendi tagged this 28 Oct 11:36
Real JavaScript files carry raw NUL bytes inside string literals, and
Bifrost refuses a source file whose parse has an ERROR around a NUL.
The Brokk TypeScript grammar accepts NUL payloads since 0.23.6; plain
.js files parse with this grammar, so they were still refused.

Port the same change:

- string fragments, escape sequences, comments and JSX attribute
  strings give NUL its own higher-precedence alternative, because the
  pinned generator otherwise folds NUL into a negated character class
  that excludes it;
- the external scanner tests lexer->eof() instead of lookahead == 0, so
  a raw NUL in template text, comments, html comments and JSX text is
  content while end of input still ends (and errors) the token.

A raw NUL in an identifier, an operator, the import keyword or a
template substitution remains a parse error. Rust tests cover accepted
payloads, rejected executable NULs, unterminated content at EOF, and
incremental edits that insert and remove a NUL.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Assets 2
Loading