Merge branch 'master' of git://factorcode.org/git/factor
commit
d5be81a594
|
@ -47,7 +47,8 @@
|
|||
(substring-no-properties (thing-at-point 'line)))))
|
||||
(when in-usings (setq line (concat "! " line)))
|
||||
(push line lines))
|
||||
(when (and in-usings (looking-at ".*\\_<;\\_>")) (setq in-usings nil))
|
||||
(when (and in-usings (looking-at "\\(^\\|.* \\);\\( \\|\n\\)"))
|
||||
(setq in-usings nil))
|
||||
(forward-line))
|
||||
(reverse lines))))))
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -82,12 +82,24 @@
|
|||
((looking-at "\\(TUPLE\\|SYMBOLS\\|VARS\\): ")
|
||||
'factor-font-lock-symbol)
|
||||
(t 'default))))
|
||||
((char-equal (char-after (nth 8 state)) ?U)
|
||||
'factor-font-lock-parsing-word)
|
||||
(t 'factor-font-lock-comment)))
|
||||
|
||||
(defconst fuel-font-lock--font-lock-keywords
|
||||
`((,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
|
||||
|
||||
|
@ -239,10 +249,10 @@
|
|||
("\\_<<\\(\"\\)\\_>" (1 "\""))
|
||||
("\\_<\\(\"\\)>\\_>" (1 "\""))
|
||||
;; Multiline constructs
|
||||
("\\_<USING:\\( \\)\\(;\\)" (1 "<b") (2 ">b"))
|
||||
("\\_<\\(U\\)SING: \\(;\\)" (1 "<b") (2 ">b"))
|
||||
("\\_<USING:\\( \\)" (1 "<b"))
|
||||
("\\_<TUPLE: +\\w+? +< +\\w+? *\\( \\)" (1 "<b"))
|
||||
("\\_<\\(TUPLE\\|SYMBOLS\\|VARS\\): +\\w+? *\\( \\)\\([^<]\\|\\_>\\)" (2 "<b"))
|
||||
("\\_<\\(TUPLE\\|SYMBOLS\\|VARS\\): +\\w+? *\\( \\)\\([^<\n]\\|\\_>\\)" (2 "<b"))
|
||||
("\\(\n\\| \\);\\_>" (1 ">b"))
|
||||
;; Let and lambda:
|
||||
("\\_<\\(!(\\) .* \\()\\)" (1 "<") (2 ">"))
|
||||
|
|
Loading…
Reference in New Issue