@@ -204,52 +204,48 @@ Returns keywords suitable for `font-lock-keywords'."
204204 (concat line-prefix " \\ (" varid " \\ |" conid " \\ )\\ s-*`\\ (" varid " \\ )`" ))
205205 (topdecl-sym
206206 (concat line-prefix " \\ (" varid " \\ |" conid " \\ )\\ s-*\\ (" sym " \\ )" ))
207- (topdecl-sym2 (concat line-prefix " (\\ (" sym " \\ ))" ))
208-
209- keywords)
210-
211- (setq keywords
212- `(; ; NOTICE the ordering below is significant
213- ; ;
214- (, toplevel-keywords 1 (symbol-value 'purescript-keyword-face ))
215- (, reservedid 1 (symbol-value 'purescript-keyword-face ))
216- (, reservedsym 1 (symbol-value 'purescript-operator-face ))
217- ; ; Special case for `as' , `hiding' , `safe' and `qualified' , which are
218- ; ; keywords in import statements but are not otherwise reserved.
219- (" \\ <import[ \t ]+\\ (?:\\ (safe\\ >\\ )[ \t ]*\\ )?\\ (?:\\ (qualified\\ >\\ )[ \t ]*\\ )?[^ \t\n ()]+[ \t ]*\\ (?:\\ (\\ <as\\ >\\ )[ \t ]*[^ \t\n ()]+[ \t ]*\\ )?\\ (\\ <hiding\\ >\\ )?"
220- (1 (symbol-value 'purescript-keyword-face ) nil lax)
221- (2 (symbol-value 'purescript-keyword-face ) nil lax)
222- (3 (symbol-value 'purescript-keyword-face ) nil lax)
223- (4 (symbol-value 'purescript-keyword-face ) nil lax))
224-
225- ; ; Case for `foreign import'
226- (,(rx line-start (0+ whitespace)
227- (group " foreign" ) (1+ whitespace) (group " import" ) word-end)
228- (1 (symbol-value 'purescript-keyword-face ) nil lax)
229- (2 (symbol-value 'purescript-keyword-face ) nil lax))
230-
231- ; ; Toplevel Declarations.
232- ; ; Place them *before* generic id-and-op highlighting.
233- (, topdecl-var (1 (symbol-value 'purescript-definition-face )))
234- (, topdecl-var2 (2 (symbol-value 'purescript-definition-face )))
235- (, topdecl-sym (2 (symbol-value 'purescript-definition-face )))
236- (, topdecl-sym2 (1 (symbol-value 'purescript-definition-face )))
237-
238- ; ; These four are debatable...
239- (" (\\ (,*\\ |->\\ ))" 0 (symbol-value 'purescript-constructor-face ))
240- (" \\ [\\ ]" 0 (symbol-value 'purescript-constructor-face ))
241- ; ; Expensive.
242- (, qvarid 0 (symbol-value 'purescript-default-face ))
243- (, qconid 0 (symbol-value 'purescript-constructor-face ))
244- (,(concat " \` " varid " \` " ) 0 (symbol-value 'purescript-operator-face ))
245- ; ; Expensive.
246- (, conid 0 (symbol-value 'purescript-constructor-face ))
247-
248- ; ; Very expensive.
249- (, sym 0 (if (eq (char-after (match-beginning 0 )) ?: )
250- purescript-constructor-face
251- purescript-operator-face))))
252- keywords))
207+ (topdecl-sym2 (concat line-prefix " (\\ (" sym " \\ ))" )))
208+
209+ `(; ; NOTICE the ordering below is significant
210+ ; ;
211+ (, toplevel-keywords 1 (symbol-value 'purescript-keyword-face ))
212+ (, reservedid 1 (symbol-value 'purescript-keyword-face ))
213+ (, reservedsym 1 (symbol-value 'purescript-operator-face ))
214+ ; ; Special case for `as' , `hiding' , `safe' and `qualified' , which are
215+ ; ; keywords in import statements but are not otherwise reserved.
216+ (" \\ <import[ \t ]+\\ (?:\\ (safe\\ >\\ )[ \t ]*\\ )?\\ (?:\\ (qualified\\ >\\ )[ \t ]*\\ )?[^ \t\n ()]+[ \t ]*\\ (?:\\ (\\ <as\\ >\\ )[ \t ]*[^ \t\n ()]+[ \t ]*\\ )?\\ (\\ <hiding\\ >\\ )?"
217+ (1 (symbol-value 'purescript-keyword-face ) nil lax)
218+ (2 (symbol-value 'purescript-keyword-face ) nil lax)
219+ (3 (symbol-value 'purescript-keyword-face ) nil lax)
220+ (4 (symbol-value 'purescript-keyword-face ) nil lax))
221+
222+ ; ; Case for `foreign import'
223+ (,(rx line-start (0+ whitespace)
224+ (group " foreign" ) (1+ whitespace) (group " import" ) word-end)
225+ (1 (symbol-value 'purescript-keyword-face ) nil lax)
226+ (2 (symbol-value 'purescript-keyword-face ) nil lax))
227+
228+ ; ; Toplevel Declarations.
229+ ; ; Place them *before* generic id-and-op highlighting.
230+ (, topdecl-var (1 (symbol-value 'purescript-definition-face )))
231+ (, topdecl-var2 (2 (symbol-value 'purescript-definition-face )))
232+ (, topdecl-sym (2 (symbol-value 'purescript-definition-face )))
233+ (, topdecl-sym2 (1 (symbol-value 'purescript-definition-face )))
234+
235+ ; ; These four are debatable...
236+ (" (\\ (,*\\ |->\\ ))" 0 (symbol-value 'purescript-constructor-face ))
237+ (" \\ [\\ ]" 0 (symbol-value 'purescript-constructor-face ))
238+ ; ; Expensive.
239+ (, qvarid 0 (symbol-value 'purescript-default-face ))
240+ (, qconid 0 (symbol-value 'purescript-constructor-face ))
241+ (,(concat " \` " varid " \` " ) 0 (symbol-value 'purescript-operator-face ))
242+ ; ; Expensive.
243+ (, conid 0 (symbol-value 'purescript-constructor-face ))
244+
245+ ; ; Very expensive.
246+ (, sym 0 (if (eq (char-after (match-beginning 0 )) ?: )
247+ purescript-constructor-face
248+ purescript-operator-face)))))
253249
254250; ; The next three aren't used in Emacs 21.
255251
0 commit comments