]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: better symbol-capturing regexp and support for X-FUNCTION
authorBjörn Lindqvist <bjourne@gmail.com>
Sat, 2 Jul 2016 01:28:19 +0000 (03:28 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Sat, 2 Jul 2016 13:50:59 +0000 (15:50 +0200)
misc/fuel/factor-mode.el
misc/fuel/strange-syntax.factor

index 95ec91bd0d5176d2aa21c18e3f54720dc6358d12..c810d0d293e97c5764cd881b3e2caf25ac3bcd0e 100644 (file)
@@ -178,7 +178,7 @@ these lines in your .emacs:
 ;;; Regexps galore:
 
 ;; Utility regexp used by other regexps to match a Factor symbol name
-(setq-local symbol-nc "\\(?:\\sw\\|\\s_\\|\\s(\\|\\s)\\|\\s\\\\)+")
+(setq-local symbol-nc "\\(?:\\sw\\|\\s_\\|\"\\|\\s(\\|\\s)\\|\\s\\\\)+")
 (setq-local symbol (format "\\(%s\\)" symbol-nc))
 (setq-local ws+ "[ \n\t]+")
 (setq-local symbols-to-semicolon "\\([^;\t]*\\)\\(;\\)")
@@ -390,7 +390,11 @@ these lines in your .emacs:
   (concat (syntax-begin '("PREDICATE")) ws+ symbol ws+ "\\(<\\)" ws+ symbol))
 
 (defconst factor-alien-function-regex
-  (concat (syntax-begin '("GL-FUNCTION" "FUNCTION" "GL-CALLBACK" "CALLBACK"))
+  (concat (syntax-begin '("CALLBACK"
+                          "FUNCTION"
+                          "GL-CALLBACK"
+                          "GL-FUNCTION"
+                          "X-FUNCTION"))
           ws+ symbol
           ws+ symbol ws+))
 
index 7a13ffd681fdb40b50046aa7d10e893137b4183d..40e608f92b7cd8045ff292afade1b6767ca93714 100644 (file)
@@ -51,7 +51,9 @@ C-TYPE: cairo_snurface_t
 ! ! CHAR
 : stuff-with-chars ( -- K \n )
     CHAR: K
-    CHAR: \n ;
+    CHAR: \n
+    CHAR: \"        ! <- \" should be highlighted
+    drop ;
 
 ! ! MAIN
 : majn ( -- ) ;