Skip to content

Commit

Permalink
Fix #462.
Browse files Browse the repository at this point in the history
Fixed making the lexer detect the number after "do".
  • Loading branch information
Matafou committed Mar 2, 2020
1 parent 2a17093 commit 21debc1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions coq/coq-smie.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)) "{|")

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 21debc1

Please sign in to comment.