@@ -183,36 +183,14 @@ Returns keywords suitable for `font-lock-keywords'."
183183 ; ; "^>", otherwise a line of code starts with "^".
184184 (line-prefix (if (eq literate 'bird ) " ^> ?" " ^" ))
185185
186- ; ; Most names are borrowed from the lexical syntax of the Haskell
187- ; ; report.
188- ; ; Some of these definitions have been superseded by using the
189- ; ; syntax table instead.
190-
191- ; ; (ASCsymbol "-!#$%&*+./<=>?@\\\\ ^|~")
192- ; ; Put the minus first to make it work in ranges.
193-
194- ; ; We allow _ as the first char to fit GHC
195186 (varid " \\ b[[:lower:]_][[:alnum:]'_]*\\ b" )
196187 ; ; We allow ' preceding conids because of DataKinds/PolyKinds
197188 (conid " \\ b'?[[:upper:]][[:alnum:]'_]*\\ b" )
198189 (modid (concat " \\ b" conid " \\ (\\ ." conid " \\ )*\\ b" ))
199190 (qvarid (concat modid " \\ ." varid))
200191 (qconid (concat modid " \\ ." conid))
201- (sym
202- ; ; We used to use the below for non-Emacs21, but I think the
203- ; ; regexp based on syntax works for other emacsen as well. -- Stef
204- ; ; (concat "[" symbol ":]+")
205- ; ; Add backslash to the symbol-syntax chars. This seems to
206- ; ; be thrown for some reason by backslash's escape syntax.
207- " \\ (\\ s.\\ |\\\\\\ )+" )
208-
209- ; ; Reserved operations
210- (reservedsym
211- (concat " \\ S."
212- ; ; (regexp-opt '(".." "::" "=" "\\ " "|" "<-" "->"
213- ; ; "@" "~" "=>") t)
214- " \\ (->\\ |→\\ |\\ .\\ .\\ |::\\ |∷\\ |<-\\ |←\\ |=>\\ |[=@\\ |~]\\ )"
215- " \\ S." ))
192+ (sym " \\ s.+" )
193+
216194 ; ; Reserved identifiers
217195 (reservedid
218196 (concat " \\ <"
@@ -227,15 +205,6 @@ Returns keywords suitable for `font-lock-keywords'."
227205 " \\ (_\\ |c\\ (ase\\ |lass\\ )\\ |d\\ (ata\\ |e\\ (fault\\ |riving\\ )\\ |o\\ )\\ |else\\ |i\\ (mport\\ |n\\ (fix[lr]?\\ |stance\\ )\\ |[fn]\\ )\\ |let\\ |module\\ |mdo\\ |newtype\\ |of\\ |rec\\ |proc\\ |t\\ (hen\\ |ype\\ )\\ |where\\ )"
228206 " \\ >" ))
229207
230- ; ; This unreadable regexp matches strings and character
231- ; ; constants. We need to do this with one regexp to handle
232- ; ; stuff like '"':"'". The regexp is the composition of
233- ; ; "([^"\\ ]|\\ .)*" for strings and '([^\\ ]|\\ .[^']*)' for
234- ; ; characters, allowing for string continuations.
235- ; ; Could probably be improved...
236- (string-and-char
237- (concat " \\ (\\ (\" \\ |" line-prefix " [ \t ]*\\\\\\ )\\ ([^\" \\\\ \n ]\\ |\\\\ .\\ )*\\ (\" \\ |\\\\ [ \t ]*$\\ )\\ |'\\ ([^'\\\\ \n ]\\ |\\\\ .[^'\n ]*\\ )'\\ )" ))
238-
239208 ; ; Top-level declarations
240209 (topdecl-var
241210 (concat line-prefix " \\ (" varid " \\ (?:\\ s-*,\\ s-*" varid " \\ )*" " \\ )\\ s-*"
@@ -265,7 +234,7 @@ Returns keywords suitable for `font-lock-keywords'."
265234 ,@(haskell-font-lock-symbols-keywords)
266235
267236 (, reservedid 1 haskell-keyword-face)
268- ( , reservedsym 1 haskell-operator-face)
237+
269238 ; ; Special case for `as' , `hiding' , `safe' and `qualified' , which are
270239 ; ; keywords in import statements but are not otherwise reserved.
271240 (" \\ <import[ \t ]+\\ (?:\\ (safe\\ >\\ )[ \t ]*\\ )?\\ (?:\\ (qualified\\ >\\ )[ \t ]*\\ )?\\ (?:\" [^\" ]*\" [\t ]*\\ )?[^ \t\n ()]+[ \t ]*\\ (?:\\ (\\ <as\\ >\\ )[ \t ]*[^ \t\n ()]+[ \t ]*\\ )?\\ (\\ <hiding\\ >\\ )?"
@@ -274,7 +243,6 @@ Returns keywords suitable for `font-lock-keywords'."
274243 (3 haskell-keyword-face nil lax)
275244 (4 haskell-keyword-face nil lax))
276245
277- (, reservedsym 1 haskell-operator-face)
278246 ; ; Special case for `foreign import'
279247 ; ; keywords in foreign import statements but are not otherwise reserved.
280248 (" \\ <\\ (foreign\\ )[ \t ]+\\ (import\\ )[ \t ]+\\ (?:\\ (ccall\\ |stdcall\\ |cplusplus\\ |jvm\\ |dotnet\\ )[ \t ]+\\ )?\\ (?:\\ (safe\\ |unsafe\\ |interruptible\\ )[ \t ]+\\ )?"
@@ -283,7 +251,6 @@ Returns keywords suitable for `font-lock-keywords'."
283251 (3 haskell-keyword-face nil lax)
284252 (4 haskell-keyword-face nil lax))
285253
286- (, reservedsym 1 haskell-operator-face)
287254 ; ; Special case for `foreign export'
288255 ; ; keywords in foreign export statements but are not otherwise reserved.
289256 (" \\ <\\ (foreign\\ )[ \t ]+\\ (export\\ )[ \t ]+\\ (?:\\ (ccall\\ |stdcall\\ |cplusplus\\ |jvm\\ |dotnet\\ )[ \t ]+\\ )?"
@@ -302,31 +269,19 @@ Returns keywords suitable for `font-lock-keywords'."
302269 ; ; These four are debatable...
303270 (" (\\ (,*\\ |->\\ ))" 0 haskell-constructor-face)
304271 (" \\ [\\ ]" 0 haskell-constructor-face)
305- ; ; Expensive.
272+
306273 (,(concat " `" varid " `" ) 0 haskell-operator-face)
307274 (,(concat " `" conid " `" ) 0 haskell-operator-face)
308275 (,(concat " `" qvarid " `" ) 0 haskell-operator-face)
309276 (,(concat " `" qconid " `" ) 0 haskell-operator-face)
310277 (, qvarid 0 haskell-default-face)
311278 (, qconid 0 haskell-constructor-face)
312- ; ; Expensive.
279+
313280 (, conid 0 haskell-constructor-face)
314281
315- ; ; Very expensive.
316282 (, sym 0 (if (eq (char-after (match-beginning 0 )) ?: )
317283 haskell-constructor-face
318284 haskell-operator-face))))
319- (unless (boundp 'font-lock-syntactic-keywords )
320- (cl-case literate
321- (bird
322- (setq keywords
323- `((" ^[^>\n ].*$" 0 haskell-comment-face t )
324- ,@keywords
325- (" ^>" 0 haskell-default-face t ))))
326- ((latex tex)
327- (setq keywords
328- `((haskell-font-lock-latex-comments 0 'font-lock-comment-face t )
329- ,@keywords )))))
330285 keywords))
331286
332287(defvar haskell-font-lock-latex-cache-pos nil
0 commit comments