diff options
author | David Aspinall <da@inf.ed.ac.uk> | 2010-09-22 09:56:59 +0000 |
---|---|---|
committer | David Aspinall <da@inf.ed.ac.uk> | 2010-09-22 09:56:59 +0000 |
commit | eb6f017f823ff323570a76941e69218fbd07de8d (patch) | |
tree | c348d97df7259a991a00ba1fc48f667593fb2bbc /coq/coq-db.el | |
parent | 97c62745bd410daff598e03d797da4b67af033f3 (diff) |
Fix some bugs in coq regexp generation
Diffstat (limited to 'coq/coq-db.el')
-rw-r--r-- | coq/coq-db.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/coq/coq-db.el b/coq/coq-db.el index 020e3291..a91fb3c9 100644 --- a/coq/coq-db.el +++ b/coq/coq-db.el @@ -93,17 +93,20 @@ regexp. See `coq-syntax-db' for DB structure." (let ((l db) res) (while l (let* ((hd (car l)) (tl (cdr l)) ; hd is the first infos list - (color (concat "\\_<" (nth 4 hd) "\\_>"))) ; colorization string -; (color (nth 4 hd))) ; colorization string + (color (nth 4 hd))) ; colorization string +; da: do this below, otherwise we get empty words in result!! +; (color (concat "\\_<" (nth 4 hd) "\\_>"))) ; colorization string ;; TODO delete doublons (when (and color (or (not filter) (funcall filter hd))) - (setq res (nconc res (list color)))) ; careful: nconc destructive! + (setq res + (nconc res (list + (concat "\\_<" color "\\_>"))))) (setq l tl))) res)) (defun coq-build-opt-regexp-from-db (db &optional filter) "Take a keyword database DB and return a regexps for font-lock. -If non-nil Optional argument FILTER is a function applying to each line of DB. +If non-nil optional argument FILTER is a function applying to each line of DB. For each line if FILTER returns nil, then the keyword is not added to the regexp. See `coq-syntax-db' for DB structure." (let ((l db) res) @@ -114,7 +117,9 @@ regexp. See `coq-syntax-db' for DB structure." (when (and color (or (not filter) (funcall filter hd))) (setq res (nconc res (list color)))) ; careful: nconc destructive! (setq l tl))) - (proof-ids-to-regexp res))) +; da: next call is wrong? +; (proof-ids-to-regexp res))) + (proof-regexp-alt-list res))) ;; Computes the max length of strings in a list |