Skip to content

Commit

Permalink
Support identifiers involving @
Browse files Browse the repository at this point in the history
This symbol is supported by the existing corset tool.  Therefore, to
maintain backwards compatibility ... it must also be supported.
  • Loading branch information
DavePearce committed Dec 20, 2024
1 parent 4280d78 commit 76920cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/corset/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ func isIdentifierStart(c rune) bool {
}

func isIdentifierMiddle(c rune) bool {
return unicode.IsDigit(c) || isIdentifierStart(c) || c == '-' || c == '!'
return unicode.IsDigit(c) || isIdentifierStart(c) || c == '-' || c == '!' || c == '@'
}

func isFunctionIdentifierStart(c rune) bool {
Expand Down
4 changes: 2 additions & 2 deletions testdata/purefun_06.lisp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(defcolumns X Y)
(defun (double x) (+ x x))
(defun (double@d x) (+ x x))
(defpurefun ((~eq :@loob) x y) (~ (- x y)))

;; Y == 2 * X
(defconstraint c1 () (~eq Y (double X)))
(defconstraint c1 () (~eq Y (double@d X)))

0 comments on commit 76920cd

Please sign in to comment.