128128; ; This is probably just wrong, but it used to use
129129; ; `font-lock-function-name-face' with a result that was not consistent with
130130; ; other major modes, so I just exchanged with `purescript-definition-face' .
131- (defvar purescript-operator-face 'font-lock-variable-name -face )
131+ (defvar purescript-operator-face 'font-lock-builtin -face )
132132(defvar purescript-default-face nil )
133133(defvar purescript-literate-comment-face 'font-lock-doc-face
134134 " Face with which to fontify literate comments.
@@ -165,12 +165,10 @@ Returns keywords suitable for `font-lock-keywords'."
165165 ; ; be thrown for some reason by backslash's escape syntax.
166166 " \\ (\\ s_\\ |\\\\\\ )+" )
167167
168- ; ; Reserved operations
169- (reservedsym
168+ (operator
170169 (concat " \\ S_"
171- ; ; (regexp-opt '(".." "::" "=" "\\ " "|" "<-" "->"
172- ; ; "@" "~" "=>") t)
173- " \\ (->\\ |\\ .\\ .\\ |::\\ |∷\\ |<-\\ |=>\\ |[=@\\ |~]\\ )"
170+ ; ; All punctuation, excluding (),;[]{}_"'`
171+ " \\ ([!@#$%^&*+\\ -./<=>?@|~:∷\\\\ ]+\\ )"
174172 " \\ S_" ))
175173 ; ; These are only keywords when appear at top-level, optionally with
176174 ; ; indentation. They are not reserved and in other levels would represent
@@ -210,7 +208,7 @@ Returns keywords suitable for `font-lock-keywords'."
210208 ; ;
211209 (, toplevel-keywords 1 (symbol-value 'purescript-keyword-face ))
212210 (, reservedid 1 (symbol-value 'purescript-keyword-face ))
213- (, reservedsym 1 (symbol-value 'purescript-operator-face ))
211+ (, operator 1 (symbol-value 'purescript-operator-face ))
214212 ; ; Special case for `as' , `hiding' , `safe' and `qualified' , which are
215213 ; ; keywords in import statements but are not otherwise reserved.
216214 (" \\ <import[ \t ]+\\ (?:\\ (safe\\ >\\ )[ \t ]*\\ )?\\ (?:\\ (qualified\\ >\\ )[ \t ]*\\ )?[^ \t\n ()]+[ \t ]*\\ (?:\\ (\\ <as\\ >\\ )[ \t ]*[^ \t\n ()]+[ \t ]*\\ )?\\ (\\ <hiding\\ >\\ )?"
@@ -232,13 +230,12 @@ Returns keywords suitable for `font-lock-keywords'."
232230 (, topdecl-sym (2 (symbol-value 'purescript-definition-face )))
233231 (, topdecl-sym2 (1 (symbol-value 'purescript-definition-face )))
234232
235- ; ; These four are debatable...
236- (" (\\ (,*\\ |->\\ ))" 0 (symbol-value 'purescript-constructor-face ))
233+ ; ; This one is debatable…
237234 (" \\ [\\ ]" 0 (symbol-value 'purescript-constructor-face ))
238235 ; ; Expensive.
239236 (, qvarid 0 (symbol-value 'purescript-default-face ))
240237 (, qconid 0 (symbol-value 'purescript-constructor-face ))
241- (,(concat " \ `" varid " \ `" ) 0 (symbol-value 'purescript-operator-face ))
238+ (,(concat " `" varid " `" ) 0 (symbol-value 'purescript-operator-face ))
242239 ; ; Expensive.
243240 (, conid 0 (symbol-value 'purescript-constructor-face ))
244241
0 commit comments