aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Courtieu2020-03-02 14:48:21 +0100
committerPierre Courtieu2020-03-02 14:48:21 +0100
commit21debc12c6771bc00ed6ae1e1b37312e8205ec93 (patch)
tree1cf778c1219b92e3f380b1223eb90379b155d4e5
parent2a17093f6a7b168fedabc623602edec35aef8d8a (diff)
Fix #462.
Fixed making the lexer detect the number after "do".
-rw-r--r--coq/coq-smie.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/coq/coq-smie.el b/coq/coq-smie.el
index e960ff19..f07ad4ed 100644
--- a/coq/coq-smie.el
+++ b/coq/coq-smie.el
@@ -523,6 +523,9 @@ The point should be at the beginning of the command name."
((member tok '("End"))
(save-excursion (coq-smie-backward-token)))
+ ((member tok '("do"))
+ (save-excursion (coq-smie-backward-token-aux)))
+
; empty token if a prenthesis is met.
((and (zerop (length tok)) (looking-at "{|")) (goto-char (match-end 0)) "{|")
@@ -650,6 +653,15 @@ The point should be at the beginning of the command name."
"|| tactic"
"||"))))))
+ ;; This may be part of monadic notation, so detect other uses of "do".
+ ((equal tok "do")
+ (save-excursion
+ (forward-char 2)
+ (smie-default-forward-token)
+ (smie-default-backward-token)
+ (if (looking-at "[0-9]") "do ltac"
+ "do")))
+
; Same for "->" : rewrite or intro arg or term's implication
; FIXME: user defined arrows will be considered a term