FUEL: Better font lock for <" "> forms.
parent
befeff625d
commit
5c1d6b12c8
|
@ -73,8 +73,9 @@
|
||||||
;;; Font lock:
|
;;; Font lock:
|
||||||
|
|
||||||
(defun fuel-font-lock--syntactic-face (state)
|
(defun fuel-font-lock--syntactic-face (state)
|
||||||
(cond ((nth 3 state) 'factor-font-lock-string)
|
(if (nth 3 state) 'factor-font-lock-string
|
||||||
((char-equal (char-after (nth 8 state)) ?\ )
|
(let ((c (char-after (nth 8 state))))
|
||||||
|
(cond ((char-equal c ?\ )
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (nth 8 state))
|
(goto-char (nth 8 state))
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
|
@ -82,11 +83,10 @@
|
||||||
((looking-at "\\(TUPLE\\|SYMBOLS\\|VARS\\): ")
|
((looking-at "\\(TUPLE\\|SYMBOLS\\|VARS\\): ")
|
||||||
'factor-font-lock-symbol)
|
'factor-font-lock-symbol)
|
||||||
(t 'default))))
|
(t 'default))))
|
||||||
((char-equal (char-after (nth 8 state)) ?U)
|
((char-equal c ?U) 'factor-font-lock-parsing-word)
|
||||||
'factor-font-lock-parsing-word)
|
((char-equal c ?\() 'factor-font-lock-stack-effect)
|
||||||
((char-equal (char-after (nth 8 state)) ?\()
|
((char-equal c ?\") 'factor-font-lock-string)
|
||||||
'factor-font-lock-stack-effect)
|
(t 'factor-font-lock-comment)))))
|
||||||
(t 'factor-font-lock-comment)))
|
|
||||||
|
|
||||||
(defconst fuel-font-lock--font-lock-keywords
|
(defconst fuel-font-lock--font-lock-keywords
|
||||||
`((,fuel-syntax--stack-effect-regex . 'factor-font-lock-stack-effect)
|
`((,fuel-syntax--stack-effect-regex . 'factor-font-lock-stack-effect)
|
||||||
|
|
|
@ -247,8 +247,8 @@
|
||||||
("\\_<\\((\\) \\([^)\n]*?\\) \\()\\)\\_>" (1 "<b") (2 "w") (3 ">b"))
|
("\\_<\\((\\) \\([^)\n]*?\\) \\()\\)\\_>" (1 "<b") (2 "w") (3 ">b"))
|
||||||
;; Strings
|
;; Strings
|
||||||
("\\_<\\(\"\\)\\([^\n\r\f\"]\\|\\\\\"\\)*\\(\"\\)\\_>" (1 "\"") (3 "\""))
|
("\\_<\\(\"\\)\\([^\n\r\f\"]\\|\\\\\"\\)*\\(\"\\)\\_>" (1 "\"") (3 "\""))
|
||||||
("\\_<<\\(\"\\)\\_>" (1 "\""))
|
("\\_<<\\(\"\\)\\_>" (1 "<b"))
|
||||||
("\\_<\\(\"\\)>\\_>" (1 "\""))
|
("\\_<\\(\"\\)>\\_>" (1 ">b"))
|
||||||
;; Multiline constructs
|
;; Multiline constructs
|
||||||
("\\_<\\(U\\)SING: \\(;\\)" (1 "<b") (2 ">b"))
|
("\\_<\\(U\\)SING: \\(;\\)" (1 "<b") (2 ">b"))
|
||||||
("\\_<USING:\\( \\)" (1 "<b"))
|
("\\_<USING:\\( \\)" (1 "<b"))
|
||||||
|
|
Loading…
Reference in New Issue