Lines Matching refs:scanner
13 // This file starts with two simple examples using the scanner
14 // before diving into the scanner itself.
20 return checkValid(data, &scanner{}) == nil
25 func checkValid(data []byte, scan *scanner) error {
42 func nextValue(data []byte, scan *scanner) (value, rest []byte, err error) {
48 // probe the scanner with a space to determine whether we will
76 // A scanner is a JSON scanning state machine.
88 type scanner struct {
93 step func(*scanner, byte) int
107 redoState func(*scanner, byte) int
114 // assigned to scanner.state and the method scanner.eof.
118 // call to scanner.state: if one call returns scanError,
135 scanError // hit an error, scanner.err.
148 // reset prepares the scanner for use.
150 func (s *scanner) reset() {
158 // eof tells the scanner that the end of input has been reached.
160 func (s *scanner) eof() int {
178 func (s *scanner) pushParseState(p int) {
184 func (s *scanner) popParseState() {
201 func stateBeginValueOrEmpty(s *scanner, c byte) int {
212 func stateBeginValue(s *scanner, c byte) int {
252 func stateBeginStringOrEmpty(s *scanner, c byte) int {
265 func stateBeginString(s *scanner, c byte) int {
278 func stateEndValue(s *scanner, c byte) int {
327 func stateEndTop(s *scanner, c byte) int {
336 func stateInString(s *scanner, c byte) int {
352 func stateInStringEsc(s *scanner, c byte) int {
365 func stateInStringEscU(s *scanner, c byte) int {
375 func stateInStringEscU1(s *scanner, c byte) int {
385 func stateInStringEscU12(s *scanner, c byte) int {
395 func stateInStringEscU123(s *scanner, c byte) int {
405 func stateNeg(s *scanner, c byte) int {
419 func state1(s *scanner, c byte) int {
428 func state0(s *scanner, c byte) int {
442 func stateDot(s *scanner, c byte) int {
452 func stateDot0(s *scanner, c byte) int {
465 func stateE(s *scanner, c byte) int {
475 func stateESign(s *scanner, c byte) int {
486 func stateE0(s *scanner, c byte) int {
494 func stateT(s *scanner, c byte) int {
503 func stateTr(s *scanner, c byte) int {
512 func stateTru(s *scanner, c byte) int {
521 func stateF(s *scanner, c byte) int {
530 func stateFa(s *scanner, c byte) int {
539 func stateFal(s *scanner, c byte) int {
548 func stateFals(s *scanner, c byte) int {
557 func stateN(s *scanner, c byte) int {
566 func stateNu(s *scanner, c byte) int {
575 func stateNul(s *scanner, c byte) int {
585 func stateError(s *scanner, c byte) int {
590 func (s *scanner) error(c byte, context string) int {
611 // undo causes the scanner to return scanCode from the next state transition.
613 func (s *scanner) undo(scanCode int) {
615 panic("json: invalid use of scanner")
623 // stateRedo helps implement the scanner's 1-byte undo.
624 func stateRedo(s *scanner, c byte) int {