--- a/src/Pure/General/symbol.scala Mon Jul 08 22:28:02 2024 +0100
+++ b/src/Pure/General/symbol.scala Tue Jul 09 12:32:33 2024 +0200
@@ -51,6 +51,7 @@
def is_ascii_letter(c: Char): Boolean = 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'
def is_ascii_digit(c: Char): Boolean = '0' <= c && c <= '9'
+ def is_ascii_digit(b: Byte): Boolean = is_ascii_digit(b.toChar)
def is_ascii_hex(c: Char): Boolean =
'0' <= c && c <= '9' || 'A' <= c && c <= 'F' || 'a' <= c && c <= 'f'
--- a/src/Pure/General/value.scala Mon Jul 08 22:28:02 2024 +0100
+++ b/src/Pure/General/value.scala Tue Jul 09 12:32:33 2024 +0200
@@ -22,7 +22,7 @@
object Nat {
def unapply(bs: Bytes): Option[scala.Int] =
- if (bs.byte_iterator.forall(b => '0' <= b && b <= '9')) unapply(bs.text)
+ if (bs.byte_iterator.forall(Symbol.is_ascii_digit)) unapply(bs.text)
else None
def unapply(s: java.lang.String): Option[scala.Int] =
s match {
--- a/src/Pure/PIDE/byte_message.scala Mon Jul 08 22:28:02 2024 +0100
+++ b/src/Pure/PIDE/byte_message.scala Tue Jul 09 12:32:33 2024 +0200
@@ -82,7 +82,7 @@
Value.Long.unapply(str).isDefined
private def is_length(msg: Bytes): Boolean =
- !msg.is_empty && msg.byte_iterator.forall(b => Symbol.is_ascii_digit(b.toChar)) &&
+ !msg.is_empty && msg.byte_iterator.forall(Symbol.is_ascii_digit) &&
Value.Long.unapply(msg.text).isDefined
def write_line_message(stream: OutputStream, msg: Bytes): Unit = {