Skip to content

Commit

Permalink
improvement: Don't use format since it seems to break at some chars
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Dec 4, 2024
1 parent 4aa1e0f commit 0b355e0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ class LegacyScanner(input: Input, dialect: Dialect) {
}

@inline
def reportIllegalCharacter(): Unit = curr
.setInvalidToken(s"illegal character '\\u${"%04x".format(ch)}'")
def reportIllegalCharacter(): Unit = {
val output = "\\u" + Integer.toHexString(ch | 0x10000).substring(1);
curr.setInvalidToken(s"illegal character '$output'")
}

(ch: @switch) match {
case ' ' =>
Expand Down

0 comments on commit 0b355e0

Please sign in to comment.