Make bytes.Reader and strings.Reader have the same interface

This commit is contained in:
gingerBill
2020-12-04 21:25:13 +00:00
parent dd63665b58
commit 0ed1300bd6
2 changed files with 135 additions and 101 deletions
+3 -3
View File
@@ -4,9 +4,9 @@ import "core:io"
import "core:unicode/utf8"
Reader :: struct {
s: []byte,
i: i64, // current reading index
prev_rune: int, // previous reading index of rune or < 0
s: []byte, // read-only buffer
i: i64, // current reading index
prev_rune: int, // previous reading index of rune or < 0
}
reader_init :: proc(r: ^Reader, s: []byte) {