Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect syntax highlighting on lean4-debugging keyword #61

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lean4-syntax.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
(defconst lean4-warnings '("sorry") "Lean warnings.")
(defconst lean4-warnings-regexp
(eval `(rx word-start (or ,@lean4-warnings) word-end)))
(defconst lean4-debugging '("unreachable" "panic" "assert" "dbgTrace") "Lean debugging.")
(defconst lean4-debugging '("unreachable!" "panic!" "assert!" "dbg_trace") "Lean debugging.")
(defconst lean4-debugging-regexp
(eval `(rx word-start (or ,@lean4-debugging))))
(eval `(rx word-start (or ,@lean4-debugging) word-end)))


(defconst lean4-syntax-table
Expand Down Expand Up @@ -187,14 +187,15 @@
(,(rx word-start (group (or "Prop" "Type" "Sort")) ".") (1 'font-lock-type-face))
;; String
("\"[^\"]*\"" . 'font-lock-string-face)
;; Debugging builtins
(,lean4-debugging-regexp . 'font-lock-warning-face)
;; ;; Constants
(,lean4-constants-regexp . 'font-lock-constant-face)
(,lean4-numerals-regexp . 'font-lock-constant-face)
;; place holder
(,(rx symbol-start "_" symbol-end) . 'font-lock-preprocessor-face)
;; warnings
(,lean4-warnings-regexp . 'font-lock-warning-face)
(,lean4-debugging-regexp . 'font-lock-warning-face)
;; escaped identifiers
(,(rx (and (group "«") (group (one-or-more (not (any "»")))) (group "»")))
(1 font-lock-comment-face t)
Expand Down
Loading