Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/module/io.wren
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ class Stdin {
static readByte() {
return read_ {
// Peel off the first byte.
// TODO: this doing a huge amount of effort, but likely fast enough
var byte = __buffered.bytes[0]
__buffered = __buffered[1..-1]
__buffered = __buffered.bytes.skip(1).map { |x| String.fromByte(x) }.join()
return byte
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/module/io.wren.inc
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ static const char* ioModuleSource =
" static readByte() {\n"
" return read_ {\n"
" // Peel off the first byte.\n"
" // TODO: this doing a huge amount of effort, but likely fast enough\n"
" var byte = __buffered.bytes[0]\n"
" __buffered = __buffered[1..-1]\n"
" __buffered = __buffered.bytes.skip(1).map { |x| String.fromByte(x) }.join() \n"
" return byte\n"
" }\n"
" }\n"
Expand Down