charAt() returns the byte at the offset in the input source string. because the Go tokenizer discards white space, we need this method in order to check for, for example, a space after an identifier in parsing an implicit expression, because that would denote the end of that simple expression in Pus
(offset int)
| 646 | // expression, because that would denote the end of that simple expression in |
| 647 | // Pushup syntax. |
| 648 | func (p *codeParser) charAt(offset int) byte { |
| 649 | if len(p.parser.src) > offset { |
| 650 | return p.parser.src[offset] |
| 651 | } |
| 652 | return 0 |
| 653 | } |
| 654 | |
| 655 | func (p *codeParser) prev() goToken { |
| 656 | if tok, ok := Value(p.acceptedToken); ok { |