FUEL: Font lock for integers, floats and ratios.
parent
8e6be0ccef
commit
36dcb21857
|
@ -55,6 +55,8 @@
|
|||
((comment comment "comments")
|
||||
(constructor type "constructors (<foo>)")
|
||||
(constant constant "constants and literal values")
|
||||
(number constant "integers and floats")
|
||||
(ratio constant "ratios")
|
||||
(declaration keyword "declaration words")
|
||||
(parsing-word keyword "parsing words")
|
||||
(setter-word function-name "setter words (>>foo)")
|
||||
|
@ -80,7 +82,9 @@
|
|||
(,fuel-syntax--alias-definition-regex (1 'factor-font-lock-word)
|
||||
(2 'factor-font-lock-word))
|
||||
(,fuel-syntax--int-constant-def-regex 2 'factor-font-lock-constant)
|
||||
(,fuel-syntax--number-regex . 'factor-font-lock-constant)
|
||||
(,fuel-syntax--integer-regex . 'factor-font-lock-number)
|
||||
(,fuel-syntax--float-regex . 'factor-font-lock-number)
|
||||
(,fuel-syntax--ratio-regex . 'factor-font-lock-ratio)
|
||||
(,fuel-syntax--type-definition-regex 2 'factor-font-lock-type-name)
|
||||
(,fuel-syntax--method-definition-regex (1 'factor-font-lock-type-name)
|
||||
(2 'factor-font-lock-word))
|
||||
|
|
|
@ -84,8 +84,14 @@
|
|||
(defconst fuel-syntax--method-definition-regex
|
||||
"^M: +\\([^ ]+\\) +\\([^ ]+\\)")
|
||||
|
||||
(defconst fuel-syntax--number-regex
|
||||
"\\_<\\(\\+\\|-\\)?\\([0-9]+\\.?[0-9]*\\|\\.[0-9]+\\)\\([eE]\\(\\+\\|-\\)?[0-9]+\\)?\\_>")
|
||||
(defconst fuel-syntax--integer-regex
|
||||
"\\_<-?[0-9]+\\_>")
|
||||
|
||||
(defconst fuel-syntax--ratio-regex
|
||||
"\\_<-?\\([0-9]+\\+\\)?[0-9]+/-?[0-9]+\\_>")
|
||||
|
||||
(defconst fuel-syntax--float-regex
|
||||
"\\_<-?[0-9]+\\.[0-9]*\\([eE]-?[0-9]+\\)?\\_>")
|
||||
|
||||
(defconst fuel-syntax--word-definition-regex
|
||||
(fuel-syntax--second-word-regex
|
||||
|
|
Loading…
Reference in New Issue