Skip to content

Commit

Permalink
fix: treat @ as special character in identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
tauslim committed Mar 19, 2024
1 parent 7e7a2f5 commit f88cee7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
)

var (
ReservedRunes = []rune{' ', '&', '(', ')', ',', '=', '/', ';', '?', '@', '|', '[', ']'}
ReservedRunes = []rune{' ', '&', '(', ')', ',', '=', '/', ';', '?', '|', '[', ']'}
eof = rune(0)
)

Expand Down Expand Up @@ -159,8 +159,6 @@ func (s *Scanner) scanReservedRune() (tok Token, lit string) {
return SemiColon, lit
case '?':
return QuestionMark, lit
case '@':
return AtSymbol, lit
case '|':
return Pipe, lit
case '[':
Expand All @@ -186,7 +184,7 @@ func isIdent(ch rune) bool {
func isSpecialChar(ch rune) bool {
return ch == '*' || ch == '_' || ch == '%' ||
ch == '+' || ch == '-' || ch == '.' ||
ch == ':' || ch == '$'
ch == ':' || ch == '$' || ch == '@'
}

// IsLetter returns true if the rune is a letter.
Expand Down

0 comments on commit f88cee7

Please sign in to comment.