diff --git a/projects/std/src/prelude.abra b/projects/std/src/prelude.abra index 45323ee7..11b2ff63 100644 --- a/projects/std/src/prelude.abra +++ b/projects/std/src/prelude.abra @@ -243,39 +243,6 @@ type CharsIterator { } self._decodeChar() - // if self._i >= self._numBytes return None - - // val b1 = self._bytes.offset(self._i).load().asInt() - // self._i += 1 - // if b1 < 128 return Some(Char.fromInt(b1)) - - // // Begin multi-byte cases, obtain first continuation byte - // if self._i >= self._numBytes unreachable("invalid utf-8 encoding: continuation byte expected given first byte ${b1.hex()}") - // val b2 = self._bytes.offset(self._i).load().asInt() - // self._i += 1 - - // // 3-byte case - // if b1 >= 0b11100000 { - // if self._i >= self._numBytes unreachable("invalid utf-8 encoding: continuation byte expected given first byte ${b1.hex()}") - // val b3 = self._bytes.offset(self._i).load().asInt() - // self._i += 1 - - // // 4-byte case - // if b1 >= 0b11110000 { - // if self._i >= self._numBytes unreachable("invalid utf-8 encoding: continuation byte expected given first byte ${b1.hex()}") - // val b4 = self._bytes.offset(self._i).load().asInt() - // self._i += 1 - - // val ch = ((b1 && 0b00000111) << 18) || ((b2 && 0b00111111) << 12) || ((b3 && 0b00111111) << 6) || (b4 && 0b00111111) - // return Some(Char.fromInt(ch)) - // } - - // val ch = ((b1 && 0b00001111) << 12) || ((b2 && 0b00111111) << 6) || (b3 && 0b00111111) - // return Some(Char.fromInt(ch)) - // } - - // val ch = ((b1 && 0b00011111) << 6) || (b2 && 0b00111111) - // Some(Char.fromInt(ch)) } func _decodeChar(self): Char? {