Make toml.Scanner.peek return u32
parent
fb3afe884b
commit
4744fcee13
|
|
@ -315,7 +315,7 @@ fn (s Scanner) at_crlf() bool {
|
||||||
// peek returns the character code from the input text at position + `n`.
|
// peek returns the character code from the input text at position + `n`.
|
||||||
// peek returns `end_of_text` if it can't peek `n` characters ahead.
|
// peek returns `end_of_text` if it can't peek `n` characters ahead.
|
||||||
[direct_array_access; inline]
|
[direct_array_access; inline]
|
||||||
pub fn (s &Scanner) peek(n int) int {
|
pub fn (s &Scanner) peek(n int) u32 {
|
||||||
if s.pos + n < s.text.len {
|
if s.pos + n < s.text.len {
|
||||||
// Allow peeking back - needed for spaces between date and time in RFC 3339 format :/
|
// Allow peeking back - needed for spaces between date and time in RFC 3339 format :/
|
||||||
if n - 1 < 0 && s.pos + n - 1 >= 0 {
|
if n - 1 < 0 && s.pos + n - 1 >= 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue