Repository navigation
Conversation
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
Contributor
Author
|
@ggleyzer #729 is an issue, not a PR. It asks whether an escaped backslash should stop a This PR fixes a bug either way: |
Collaborator
|
Sorry, I meant #724 |
lagergren
added a commit
that referenced
this pull request
Oct 26, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
Char.appendEscaped() writes a C0 or C1 control character with no escape of its own, or a line or paragraph separator, as a backslash, a "u" and four hexits. Each hexit was computed as (codepoint & 0xF000 >>> 24), (codepoint & 0x0F00 >>> 16) and so on. Shifts and & have the same precedence in Ecstasy, left to right, so that is (codepoint & 0xF000) >>> 24: zero for every character it escapes, and the shifts were twice too large anyway. Only the last hexit was right, so U+2028 was written as \u0008, U+0085 as \u0005 and U+001F as \u000F, while U+0001 came out right by accident. Each hexit is now the code point shifted by 12, 8, 4 or 0, masked to four bits. Char.quoted(), String.quoted() and String.appendEscaped() write their escapes through it. Test: a new testEscapes() in manualTests' literals.x, which CI runs as TestLiterals, asserts the quoted forms of U+0001, U+001F, U+0085, U+2028 and a String holding U+2029. Each expected text is joined from two literals, since the compiler reads a backslash, a "u" and four hexits as the character they name anywhere in the source, also after an escaped backslash; that is issue #729.
lagergren
force-pushed
the
lagergren/fix-char-escape-hexits
branch
from
October 26, 2026 21:31
11e3296 to
7052d89
Compare
Contributor
Author
lagergren
added a commit
that referenced
this pull request
Oct 27, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 28, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 29, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 29, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Oct 29, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 2, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 4, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 5, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 9, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 11, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 22, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 26, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 26, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 27, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
lagergren
added a commit
that referenced
this pull request
Nov 28, 2026
docs/remaining.md's master candidates now name the pull requests for the two library bugs found while fixing #723 and #724: #730 writes a Char's \u escape with its own four hexits, and #731 gives a Nibble one byte as its bytes and makes a Nibble from one. Issue #729 asks whether an escaped backslash should keep a \u after it from being a Unicode escape, which #730's test has to work around. Validation: records only; the pull requests carry their own. Limits: none.
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
On master,
Char.appendEscaped()writes the wrong\uescape for every character it escapes that way, apart from those below U+0010: U+2028 comes out as\u0008, U+0085 as\u0005and U+001F as\u000F.Char.quoted(),String.quoted()andString.appendEscaped()write their escapes through it.Root cause
Each hexit was
(codepoint & 0xF000 >>> 24).toHexit(), and so on for the others. In Ecstasy, shifts and&have the same precedence and group left to right, so that is(codepoint & 0xF000) >>> 24, which is 0 for every character this escapes: the C0 and C1 control characters with no escape of their own, and U+2028 and U+2029. The shifts were also twice what they should be. Only the last hexit,(codepoint & 0x000F) >>> 0, was right.Change
Each hexit is the code point shifted by 12, 8, 4 or 0, masked to four bits.
Validation
'\u0001''\u0001''\u000F''\u001F''\u0005''\u0085''\u0008'' '"a", U+2029,"b""a\u0009b""a b"testEscapes()inmanualTests'literals.xasserts the table's quoted forms. CI runs it asTestLiterals. With master'sChar.xit fails at its second assert, U+001F.checkpasses, with the Ecstasy library tests;:javatools:testpasses 456 tests, the 42 existing skips;TestLiteralspasses throughmanualTests:runOne.Limits
uand four hexits as the character they name anywhere in the source, also after an escaped backslash. Should an escaped backslash keep a \u after it from being a Unicode escape? #729 asks whether that should change.