Skip to content

Commit

Permalink
Adjust lexer to return gqlerror where it does not break tests (#279)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Coffman <steve@khanacademy.org>
  • Loading branch information
StevenACoffman committed Sep 8, 2023
1 parent f2809bd commit d734cf8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lexer/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *Lexer) makeValueToken(kind Type, value string) (Token, error) {
}, nil
}

func (s *Lexer) makeError(format string, args ...interface{}) (Token, error) {
func (s *Lexer) makeError(format string, args ...interface{}) (Token, *gqlerror.Error) {
column := s.endRunes - s.lineStartRunes + 1
return Token{
Kind: Invalid,
Expand All @@ -74,8 +74,7 @@ func (s *Lexer) makeError(format string, args ...interface{}) (Token, error) {
// This skips over whitespace and comments until it finds the next lexable
// token, then lexes punctuators immediately or calls the appropriate helper
// function for more complicated tokens.
func (s *Lexer) ReadToken() (token Token, err error) {

func (s *Lexer) ReadToken() (Token, error) {
s.ws()
s.start = s.end
s.startRunes = s.endRunes
Expand Down

0 comments on commit d734cf8

Please sign in to comment.