:type 'hook
:group 'factor-mode)
-\f
-;;; Faces:
-
-(fuel-font-lock--define-faces
- factor-font-lock font-lock factor-mode
- ((comment comment "comments")
- (constructor type "constructors (<foo>)")
- (declaration keyword "declaration words")
- (parsing-word keyword "parsing words")
- (setter-word function-name "setter words (>>foo)")
- (stack-effect comment "stack effect specifications")
- (string string "strings")
- (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")))
-
\f
;;; Syntax table:
;;; Code:
-(require 'fuel-base)
(require 'fuel-syntax)
+(require 'fuel-base)
(require 'font-lock)
',faces)))
(,setup))))
+(fuel-font-lock--define-faces
+ factor-font-lock font-lock factor-mode
+ ((comment comment "comments")
+ (constructor type "constructors (<foo>)")
+ (declaration keyword "declaration words")
+ (parsing-word keyword "parsing words")
+ (setter-word function-name "setter words (>>foo)")
+ (getter-word function-name "getter words (foo>>)")
+ (stack-effect comment "stack effect specifications")
+ (string string "strings")
+ (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")))
+
\f
;;; Font lock:
(2 'factor-font-lock-word))
(,fuel-syntax--parent-type-regex 1 'factor-font-lock-type-name)
(,fuel-syntax--constructor-regex . 'factor-font-lock-constructor)
- (,fuel-syntax--setter-regex . 'factor-font-lock-setter-word)
+ (,fuel-syntax--setter-regex 2 'factor-font-lock-setter-word)
+ (,fuel-syntax--getter-regex 2 'factor-font-lock-getter-word)
(,fuel-syntax--symbol-definition-regex 2 'factor-font-lock-symbol)
(,fuel-syntax--use-line-regex 1 'factor-font-lock-vocabulary-name))
"Font lock keywords definition for Factor mode.")
'("flushable" "foldable" "inline" "parsing" "recursive"))
(defconst fuel-syntax--declaration-words-regex
- (regexp-opt fuel-syntax--declaration-words 'words))
+ (format "%s\\($\\| \\)"
+ (regexp-opt fuel-syntax--declaration-words 'words)))
(defsubst fuel-syntax--second-word-regex (prefixes)
(format "^%s +\\([^ \r\n]+\\)" (regexp-opt prefixes t)))
(defconst fuel-syntax--constructor-regex "<[^ >]+>")
-(defconst fuel-syntax--setter-regex "\\W>>[^ ]+\\b")
+(defconst fuel-syntax--getter-regex "\\( \\|^\\)\\([^ ]+>>\\)\\( \\|$\\)")
+(defconst fuel-syntax--setter-regex "\\( \\|^\\)\\(>>[^ ]+\\)\\( \\|$\\)")
(defconst fuel-syntax--symbol-definition-regex
(fuel-syntax--second-word-regex '("SYMBOL:" "VAR:")))