Skip to content

Commit 21debc1

Browse files
committed
Fix #462.
Fixed making the lexer detect the number after "do".
1 parent 2a17093 commit 21debc1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

coq/coq-smie.el

+12
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@ The point should be at the beginning of the command name."
523523
((member tok '("End"))
524524
(save-excursion (coq-smie-backward-token)))
525525

526+
((member tok '("do"))
527+
(save-excursion (coq-smie-backward-token-aux)))
528+
526529
; empty token if a prenthesis is met.
527530
((and (zerop (length tok)) (looking-at "{|")) (goto-char (match-end 0)) "{|")
528531

@@ -650,6 +653,15 @@ The point should be at the beginning of the command name."
650653
"|| tactic"
651654
"||"))))))
652655

656+
;; This may be part of monadic notation, so detect other uses of "do".
657+
((equal tok "do")
658+
(save-excursion
659+
(forward-char 2)
660+
(smie-default-forward-token)
661+
(smie-default-backward-token)
662+
(if (looking-at "[0-9]") "do ltac"
663+
"do")))
664+
653665

654666
; Same for "->" : rewrite or intro arg or term's implication
655667
; FIXME: user defined arrows will be considered a term

0 commit comments

Comments
 (0)