FUEL: readding factor-method-definition-regex

It is needed by the fuel-refactor--def-word function.
char-rename
Björn Lindqvist 2016-07-02 15:27:33 +02:00
parent ecb462cf29
commit 5345e32b84
2 changed files with 9 additions and 9 deletions

View File

@ -275,16 +275,17 @@ these lines in your .emacs:
(defconst factor-bad-string-regex
"\\_<\"[^>]\\([^\"\n]\\|\\\\\"\\)*\n")
(defconst factor-word-starters
'(":" "::" "GENERIC:" "GENERIC#" "DEFER:" "HOOK:"
"MACRO:" "MACRO::" "MATH:" "MEMO:" "MEMO::"
"POSTPONE:" "PRIMITIVE:" "SYNTAX:" "TYPED:" "TYPED::"))
(defconst factor-word-definition-regex
(concat
(format "\\_<\\(%s\\)" (regexp-opt factor-word-starters))
(one-symbol (regexp-opt
'(":" "::" "GENERIC:" "GENERIC#" "DEFER:" "HOOK:"
"MACRO:" "MACRO::" "MATH:" "MEMO:" "MEMO::"
"POSTPONE:" "PRIMITIVE:" "SYNTAX:" "TYPED:" "TYPED::")))
ws+ symbol))
(defconst factor-method-definition-regex
(syntax-and-2-symbols '("M" "M:" "BEFORE" "AFTER")))
;; [parsing-word] [vocab-word]
(defconst factor-vocab-ref-regex
(syntax-and-1-symbol '("IN" "USE" "QUALIFIED")))
@ -454,8 +455,7 @@ these lines in your .emacs:
(,factor-float-regex . 'factor-font-lock-number)
(,factor-ratio-regex . 'factor-font-lock-ratio)
,(factor-syntax factor-type-definition-regex '("P" "T"))
,(factor-syntax (syntax-and-2-symbols '("M" "M:" "BEFORE" "AFTER"))
'("P" "T" "W"))
,(factor-syntax factor-method-definition-regex '("P" "T" "W"))
;; Highlights tuple and struct definitions. The TUPLE/STRUCT
;; parsing word, class name and optional parent classes are

View File

@ -213,7 +213,7 @@ The word's body is put in a new method for the generic."
(save-excursion
(factor-beginning-of-defun)
(or (and (looking-at factor-method-definition-regex)
(match-string-no-properties 2))
(match-string-no-properties 3))
(and (looking-at factor-word-definition-regex)
(match-string-no-properties 2)))))