FUEL: Correct font-lock for string literals (no multiline).
parent
104b052e7e
commit
a70018bcc4
|
@ -66,7 +66,8 @@
|
|||
(symbol variable-name "name of symbol being defined")
|
||||
(type-name type "type names")
|
||||
(vocabulary-name constant "vocabulary names")
|
||||
(word function-name "word, generic or method being defined")))
|
||||
(word function-name "word, generic or method being defined")
|
||||
(invalid-syntax warning "syntactically invalid constructs")))
|
||||
|
||||
|
||||
;;; Font lock:
|
||||
|
@ -92,8 +93,8 @@
|
|||
(,fuel-syntax--constructor-regex . 'factor-font-lock-constructor)
|
||||
(,fuel-syntax--setter-regex . 'factor-font-lock-setter-word)
|
||||
(,fuel-syntax--getter-regex . 'factor-font-lock-getter-word)
|
||||
(,fuel-syntax--symbol-definition-regex 2 'factor-font-lock-symbol))
|
||||
"Font lock keywords definition for Factor mode.")
|
||||
(,fuel-syntax--symbol-definition-regex 2 'factor-font-lock-symbol)
|
||||
(,fuel-syntax--bad-string-regex . 'factor-font-lock-invalid-syntax)))
|
||||
|
||||
(defun fuel-font-lock--font-lock-setup (&optional keywords no-syntax)
|
||||
(set (make-local-variable 'comment-start) "! ")
|
||||
|
|
|
@ -93,6 +93,9 @@
|
|||
(defconst fuel-syntax--float-regex
|
||||
"\\_<-?[0-9]+\\.[0-9]*\\([eE][+-]?[0-9]+\\)?\\_>")
|
||||
|
||||
(defconst fuel-syntax--bad-string-regex
|
||||
"\"[^\"]*$")
|
||||
|
||||
(defconst fuel-syntax--word-definition-regex
|
||||
(fuel-syntax--second-word-regex
|
||||
'(":" "::" "GENERIC:" "DEFER:" "HOOK:" "MAIN:" "MATH:" "POSTPONE:"
|
||||
|
@ -211,8 +214,7 @@
|
|||
(modify-syntax-entry ?\ " " table)
|
||||
(modify-syntax-entry ?\n " " table)
|
||||
|
||||
;; Strings
|
||||
(modify-syntax-entry ?\" "\"" table)
|
||||
;; Char quote
|
||||
(modify-syntax-entry ?\\ "/" table)
|
||||
|
||||
table))
|
||||
|
@ -223,6 +225,8 @@
|
|||
("\\_<\\(#?!\\)\\(\n\\|$\\)" (1 "<") (2 ">"))
|
||||
;; CHARs:
|
||||
("CHAR: \\(.\\)\\( \\|$\\)" (1 "w"))
|
||||
;; Strings
|
||||
("\\(\"\\)[^\n\r\f]*\\(\"\\)" (1 "\"") (2 "\""))
|
||||
;; Let and lambda:
|
||||
("\\_<\\(!(\\) .* \\()\\)" (1 "<") (2 ">"))
|
||||
("\\(\\[\\)\\(let\\|wlet\\|let\\*\\)\\( \\|$\\)" (1 "(]"))
|
||||
|
|
Loading…
Reference in New Issue