FUEL: Correct font-locking of tuples with initial values.
parent
9ac1522daa
commit
0ac088ccfc
|
@ -294,12 +294,6 @@ source/docs/tests file. When set to false, you'll be asked only once."
|
||||||
(defconst factor-error-regex
|
(defconst factor-error-regex
|
||||||
(factor-second-word-regex '("ERROR:")))
|
(factor-second-word-regex '("ERROR:")))
|
||||||
|
|
||||||
(defconst factor-simple-tuple-decl-regex
|
|
||||||
"\\(TUPLE\\):[ \n]+\\(\\w+\\)[ \n]+\\([^\t;]+\\);")
|
|
||||||
|
|
||||||
(defconst factor-subclassed-tuple-decl-regex
|
|
||||||
"\\(TUPLE\\):[ \n]+\\(\\(?:\\sw\\|\\s_\\)+\\)[ \n]+<[ \n]+\\(\\(?:\\sw\\|\\s_\\)+\\)[ \n]+\\([^\t;]+\\);")
|
|
||||||
|
|
||||||
(defconst factor-constructor-regex
|
(defconst factor-constructor-regex
|
||||||
"<[^ >]+>")
|
"<[^ >]+>")
|
||||||
|
|
||||||
|
@ -468,14 +462,25 @@ source/docs/tests file. When set to false, you'll be asked only once."
|
||||||
(,factor-after-definition-regex (1 'factor-font-lock-type-name)
|
(,factor-after-definition-regex (1 'factor-font-lock-type-name)
|
||||||
(2 'factor-font-lock-word))
|
(2 'factor-font-lock-word))
|
||||||
|
|
||||||
;; Order is important, otherwise "<" will be colorized as a slot.
|
;; Highlights tuple definitions. The TUPLE parsing word, tuple
|
||||||
(,factor-subclassed-tuple-decl-regex (1 'factor-font-lock-parsing-word)
|
;; name and optional parent tuple are matched in three
|
||||||
(2 'factor-font-lock-type-name)
|
;; groups. Then the text up until the tuple definition is
|
||||||
(3 'factor-font-lock-type-name)
|
;; terminated with ";" is searched for words that are slot names
|
||||||
(4 'factor-font-lock-symbol))
|
;; which are highlighted with the face factor-font-lock-symbol.
|
||||||
(,factor-simple-tuple-decl-regex (1 'factor-font-lock-parsing-word)
|
(,"\\(TUPLE\\):[ \n]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\(?:[ \n]+<[ \n]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\)?"
|
||||||
(2 'factor-font-lock-type-name)
|
(1 'factor-font-lock-parsing-word)
|
||||||
(3 'factor-font-lock-symbol))
|
(2 'factor-font-lock-type-name)
|
||||||
|
(3 'factor-font-lock-type-name nil t)
|
||||||
|
;; A tuple slot is either a single symbol or a sequence along the
|
||||||
|
;; lines: { foo initial: "bar }
|
||||||
|
("\\(\\(?:\\sw\\|\\s_\\)+\\)\\|\\(?:{[ \n]+\\(\\(?:\\sw\\|\\s_\\)+\\)[^}]+\\)"
|
||||||
|
((lambda (&rest foo)
|
||||||
|
(save-excursion
|
||||||
|
(re-search-forward " ;" nil t)
|
||||||
|
(1- (point)))))
|
||||||
|
nil
|
||||||
|
(1 'factor-font-lock-symbol nil t)
|
||||||
|
(2 'factor-font-lock-symbol nil t)))
|
||||||
|
|
||||||
(,factor-constructor-regex . 'factor-font-lock-constructor)
|
(,factor-constructor-regex . 'factor-font-lock-constructor)
|
||||||
(,factor-setter-regex . 'factor-font-lock-setter-word)
|
(,factor-setter-regex . 'factor-font-lock-setter-word)
|
||||||
|
|
Loading…
Reference in New Issue