Merge branch 'emacs' of http://git.hacks-galore.org/jao/factor into new_ui
commit
87d8a7db93
|
@ -33,6 +33,11 @@
|
|||
|
||||
;;; Auxiliar functions:
|
||||
|
||||
(defun fuel-edit--looking-at-vocab ()
|
||||
(save-excursion
|
||||
(fuel-syntax--beginning-of-defun)
|
||||
(looking-at "USING:\\|USE:")))
|
||||
|
||||
(defun fuel-edit--try-edit (ret)
|
||||
(let* ((err (fuel-eval--retort-error ret))
|
||||
(loc (fuel-eval--retort-result ret)))
|
||||
|
@ -92,9 +97,9 @@ With prefix, asks for the word to edit."
|
|||
(fuel-completion--read-word "Edit word: ")))
|
||||
(cmd `(:fuel* ((:quote ,word) fuel-get-edit-location)))
|
||||
(marker (and (not arg) (point-marker))))
|
||||
(condition-case nil
|
||||
(fuel-edit--try-edit (fuel-eval--send/wait cmd))
|
||||
(error (fuel-edit-vocabulary nil word)))
|
||||
(if (and (not arg) (fuel-edit--looking-at-vocab))
|
||||
(fuel-edit-vocabulary nil word)
|
||||
(fuel-edit--try-edit (fuel-eval--send/wait cmd)))
|
||||
(when marker (ring-insert find-tag-marker-ring marker))))
|
||||
|
||||
(defun fuel-edit-word-doc-at-point (&optional arg word)
|
||||
|
|
|
@ -88,6 +88,16 @@
|
|||
`((,fuel-syntax--stack-effect-regex . 'factor-font-lock-stack-effect)
|
||||
(,fuel-syntax--brace-words-regex 1 'factor-font-lock-parsing-word)
|
||||
(,fuel-syntax--vocab-ref-regexp 2 'factor-font-lock-vocabulary-name)
|
||||
(,fuel-syntax--constructor-regex (1 'factor-font-lock-word)
|
||||
(2 'factor-font-lock-type-name)
|
||||
(3 'factor-font-lock-invalid-syntax nil t))
|
||||
(,fuel-syntax--typedef-regex (1 'factor-font-lock-type-name)
|
||||
(2 'factor-font-lock-type-name)
|
||||
(3 'factor-font-lock-invalid-syntax nil t))
|
||||
(,fuel-syntax--rename-regex (1 'factor-font-lock-word)
|
||||
(2 'factor-font-lock-vocabulary-name)
|
||||
(3 'factor-font-lock-word)
|
||||
(4 'factor-font-lock-invalid-syntax nil t))
|
||||
(,fuel-syntax--declaration-words-regex . 'factor-font-lock-declaration)
|
||||
(,fuel-syntax--word-definition-regex 2 'factor-font-lock-word)
|
||||
(,fuel-syntax--alias-definition-regex (1 'factor-font-lock-word)
|
||||
|
|
|
@ -187,6 +187,7 @@
|
|||
"QUALIFIED-WITH:" "QUALIFIED:"
|
||||
"RENAME:"
|
||||
"SINGLETON:" "SLOT:" "SYMBOL:"
|
||||
"TYPEDEF:"
|
||||
"USE:"
|
||||
"VAR:")))
|
||||
|
||||
|
@ -208,6 +209,15 @@
|
|||
(format ":[^ ]* [^ ]+\\(%s\\)*" fuel-syntax--stack-effect-regex)
|
||||
"M[^:]*: [^ ]+ [^ ]+"))
|
||||
|
||||
(defconst fuel-syntax--constructor-regex
|
||||
"\\_<C: +\\(\\w+\\) +\\(\\w+\\)\\( .*\\)?$")
|
||||
|
||||
(defconst fuel-syntax--typedef-regex
|
||||
"\\_<TYPEDEF: +\\(\\w+\\) +\\(\\w+\\)\\( .*\\)?$")
|
||||
|
||||
(defconst fuel-syntax--rename-regex
|
||||
"\\_<RENAME: +\\(\\w+\\) +\\(\\w+\\) +=> +\\(\\w+\\)\\( .*\\)?$")
|
||||
|
||||
|
||||
;;; Factor syntax table
|
||||
|
||||
|
|
Loading…
Reference in New Issue