FUEL: fix so that radixed numbers with commas get highlighted

locals-and-roots
Björn Lindqvist 2016-05-25 22:03:05 +02:00
parent 12d91ef72a
commit 7efad3c3c3
2 changed files with 7 additions and 3 deletions

View 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"))

View 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