]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: fix so that radixed numbers with commas get highlighted
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 25 May 2016 20:03:05 +0000 (22:03 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 25 May 2016 20:03:05 +0000 (22:03 +0200)
misc/fuel/factor-mode.el
misc/fuel/strange-syntax.factor

index a8422c4545d5688a2b00e652c460a5a2bf56f0db..e3e8932188fbb809d44ffc59ae08d3fa6c9ad586 100644 (file)
@@ -262,7 +262,7 @@ these lines in your .emacs:
   (regexp-opt factor-declaration-words 'symbols))
 
 (defconst factor-integer-regex
-  "\\_<-?\\(0[xob][0-9a-fA-F]+\\|[0-9][0-9,]*\\)\\_>")
+  (one-symbol "-?\\(?:0[xob][0-9a-fA-F][0-9a-fA-F,]*\\|[0-9][0-9,]*\\)"))
 
 (defconst factor-raw-float-regex
   "[0-9]*\\.[0-9]*\\([eEpP][+-]?[0-9]+\\)?")
@@ -439,6 +439,7 @@ these lines in your .emacs:
                  "P" 'factor-font-lock-parsing-word
                  "V" 'factor-font-lock-vocabulary-name
                  "T" 'factor-font-lock-type-name
+                 "N" 'factor-font-lock-number
                  "W" 'factor-font-lock-word)))
 
 (defun factor-group-name-to-face (group-name)
@@ -476,7 +477,7 @@ these lines in your .emacs:
     ,(factor-syntax (syntax-and-2-symbols '("ALIAS")) '("P" "W" "W"))
     ,(factor-syntax (syntax-and-1-symbol '("ALIEN" "CHAR" "NAN")) '("P" "CT"))
     ,(factor-syntax factor-types-lines-regex '("P" "T"))
-    (,factor-integer-regex . 'factor-font-lock-number)
+    ,(factor-syntax factor-integer-regex '("N"))
     (,factor-float-regex . 'factor-font-lock-number)
     (,factor-ratio-regex . 'factor-font-lock-ratio)
     ,(factor-syntax factor-type-definition-regex '("P" "T"))
index 7bf266282b8508934ae027ff220ebcc647406f61..98b59addad0b7cbf6aaa6484c6f140fbb17fc1e1 100644 (file)
@@ -4,7 +4,7 @@
 ! highlighted correctly by FUEL. So if you change something in the
 ! syntax highlighting and it breaks, things will be badly hightlighted
 ! here.
-USING: alien.syntax help.syntax math ;
+USING: alien.syntax kernel math ;
 IN: strange-syntax
 
 TUPLE: a-tuple slot1 slot2 { slot3 integer } ;
@@ -47,3 +47,6 @@ SYNTAX: ID-SYNTAX ;
 >>
 
 ID-SYNTAX ID-SYNTAX
+
+! ! Numbers
+{ -55 -0x10 100,00 1,000,000 0x2000,0000 0b01 } drop