// ReadNextTokenBytes extracts a token from a ReadWriter. It is used
// during protocol negotiation and returns a byte slice.
322534
func ReadNextTokenBytes(rw io.ReadWriter) ([]byte, error) {
	data, err := lpReadBuf(rw)
	switch err {
	case nil:
		return data, nil
	case ErrTooLarge:
		err := delimWriteBuffered(rw, []byte("messages over 64k are not allowed"))
		if err != nil {
			return nil, err
		}
		return nil, ErrTooLarge
	default:
		return nil, err
	}
}
1080005
func (p *parser) readt(t tokenType) ([]token, error) {
	var tokens []token
	for {
		token := p.read()
		tokens = append(tokens, token)
		switch token.typ {
		case tokenEOF:
			return tokens, fmt.Errorf("token %q not found", t)
		case t:
			return tokens, nil
		}
	}
}
156675
func ReadTokenFile(fpath string) (*oauth2.Token, error) {
	f, err := os.Open(fpath)
	if err != nil {
		return nil, err
	}
	tok := &oauth2.Token{}
	err = json.NewDecoder(f).Decode(tok)
	defer f.Close()
	return tok, err
}
825871
func (s *GetResourceSharesOutput) SetNextToken(v string) *GetResourceSharesOutput {
	s.NextToken = &v
	return s
}
562775
func (l *Lexer) NextToken() (t token.Token) {
	l.skipWhitespace()
	typ := resolveTokenType(l.ch)
	t.Type = typ
	switch typ {
	case token.EOF:
		t.Literal = ""
	case token.IDENT:
		if isLetter(l.ch) {
			// letters
			lit := l.readIdentifier()
			typ := token.LookupIdent(lit)
			t = l.newToken(typ, lit)
			return
		}
		if isDigit(l.ch) {
			// numbers
			lit := l.readNumber()
			t = l.newToken(token.INT, lit)
			return
		}

		t = l.newTokenRune(token.ILLEGAL, l.ch)
	default:
		t = l.newTokenRune(typ, l.ch)
	}
	l.readChar() // set the pos to the next
	return
}
360596
func (s *GetEnabledStandardsInput) SetNextToken(v string) *GetEnabledStandardsInput {
	s.NextToken = &v
	return s
}
1060322
func (s *SelectResourceConfigInput) SetNextToken(v string) *SelectResourceConfigInput {
	s.NextToken = &v
	return s
}
846442
func (s *DescribeSubscriptionFiltersInput) SetNextToken(v string) *DescribeSubscriptionFiltersInput {
	s.NextToken = &v
	return s
}
513362
func (s *GetIntegrationsOutput) SetNextToken(v string) *GetIntegrationsOutput {
	s.NextToken = &v
	return s
}
1295841
func ParseBytes(s []byte, options ...Option) (*Token, error) {
	return Parse(bytes.NewReader(s), options...)
}
606812
func (s *GetStagesInput) SetNextToken(v string) *GetStagesInput {
	s.NextToken = &v
	return s
}
164371
func (b *buffer) readNext(need int) ([]byte, error) {
	if b.length < need {
		// refill
		if err := b.fill(need); err != nil {
			return nil, err
		}
	}

	offset := b.idx
	b.idx += need
	b.length -= need
	return b.buf[offset:b.idx], nil
}
565820
func (s *ListCertificatesInput) SetNextToken(v string) *ListCertificatesInput {
	s.NextToken = &v
	return s
}
138481
func (s *ListRulesPackagesInput) SetNextToken(v string) *ListRulesPackagesInput {
	s.NextToken = &v
	return s
}
995964
func (s *DescribePlayerSessionsInput) SetNextToken(v string) *DescribePlayerSessionsInput {
	s.NextToken = &v
	return s
}
402585
func (s *ListEntityRecognizersOutput) SetNextToken(v string) *ListEntityRecognizersOutput {
	s.NextToken = &v
	return s
}
155294
func (s *GetAuthorizersInput) SetNextToken(v string) *GetAuthorizersInput {
	s.NextToken = &v
	return s
}