]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: Font lock for getters/setters fixed, with faces for both.
authorJose A. Ortega Ruiz <jao@gnu.org>
Thu, 18 Dec 2008 11:11:59 +0000 (12:11 +0100)
committerJose A. Ortega Ruiz <jao@gnu.org>
Thu, 18 Dec 2008 11:11:59 +0000 (12:11 +0100)
misc/fuel/factor-mode.el
misc/fuel/fuel-font-lock.el
misc/fuel/fuel-syntax.el

index 8cf578f0904820f0c8795410620dd67499a48700..2f6eef4f6584bfba416e893b50acddb4ec452283 100644 (file)
@@ -59,23 +59,6 @@ code in the buffer."
   :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:
 
index ba2a499b4bee3e9c772925d9a6d6004b06e184f2..616bff2defbf72ae42a978d5aa5be4bb260b5c77 100644 (file)
@@ -13,8 +13,8 @@
 
 ;;; 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:
 
@@ -59,7 +74,8 @@
                                            (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.")
index 7785c043df183a122f303154266d55f22c9a64f4..e810772bd011bcc3d9e3a961beaeb2339d21870d 100644 (file)
@@ -64,7 +64,8 @@
   '("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)))
@@ -82,7 +83,8 @@
 
 (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:")))