From c859b8a1a4a3748067f23295b75f42ca368356ef Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Sun, 4 Oct 2015 01:32:45 +0300 Subject: [PATCH] lexer: fix Position() call --- parser/lexer.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/parser/lexer.go b/parser/lexer.go index b0cc69a..2e12099 100644 --- a/parser/lexer.go +++ b/parser/lexer.go @@ -117,7 +117,6 @@ func (s *Scanner) Scan() (tok Token, lit string) { } s.tokEnd = s.currPos.Offset - return tok, s.TokenLiteral() } @@ -169,19 +168,9 @@ func (s *Scanner) TokenLiteral() string { } // Pos returns the position of the character immediately after the character or -// token returned by the last call to Next or Scan. +// token returned by the last call to Scan. func (s *Scanner) Pos() Position { - return Position{} -} - -// isSpace reports whether r is a space character. -func isSpace(r rune) bool { - return r == ' ' || r == '\t' -} - -// isEndOfLine reports whether r is an end-of-line character. -func isEndOfLine(r rune) bool { - return r == '\r' || r == '\n' + return s.currPos } func isLetter(ch rune) bool {