1
0
Fork 0

- prefixed all parsing rule for modeline parsing to avoid clash with other rules in the code.

This commit is contained in:
cage 2024-06-19 15:51:11 +02:00
parent 61f8a68313
commit 74c78adc6a
1 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@
;; PERCENT := '%'
;; TEXT := (not percent)+
(defrule key
(defrule modeline-key
(or #\%
#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m
#\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z
@ -58,15 +58,15 @@
#\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z)
(:text t))
(defrule percent #\%
(defrule modeline-percent #\%
(:constant :key))
(defrule field (and percent key))
(defrule modeline-field (and modeline-percent modeline-key))
(defrule text (+ (not percent))
(defrule modeline-text (+ (not modeline-percent))
(:text t))
(defrule modeline (* (or field text)))
(defrule modeline-modeline (* (or modeline-field modeline-text)))
(defun call-function-mapped (win key mapping)
(let ((fn (cdr (assoc key mapping :test #'string=))))