Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Aug 17, 2024
1 parent 9227c5b commit 0e481ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lexer/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (t *Lexer) Next() (Position, Token, string, string) {

default:
token = ILLEGAL
value = fmt.Sprintf("unexpected %c", string(ch))
value = fmt.Sprintf("unexpected %c", ch)
}
return pos, token, value, string(ch)
}
6 changes: 3 additions & 3 deletions lexer/lexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func tokenize(input string) ([]Info, error) {
infos := []Info{}
var err error
for {
pos, token, value := k.Next()
pos, token, value, _ := k.Next()
if token == EOF {
eofLine := strings.Count(input, "\n") + 1

Expand Down Expand Up @@ -66,7 +66,7 @@ func tokenStrings(input string) string {
output := ""
k := NewLexer([]byte(input))
for {
_, token, _ := k.Next()
_, token, _, _ := k.Next()
if token == EOF {
break
}
Expand Down Expand Up @@ -237,7 +237,7 @@ and else false for function if in nil not or return true while
func Example() {
lexer := NewLexer([]byte(`print(1234, "foo") @`))
for {
pos, tok, val := lexer.Next()
pos, tok, val, _ := lexer.Next()
if tok == EOF {
break
}
Expand Down

0 comments on commit 0e481ef

Please sign in to comment.