emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/proof-general 3b5d65d340 4/8: qrhl: Remove comments from w


From: ELPA Syncer
Subject: [nongnu] elpa/proof-general 3b5d65d340 4/8: qrhl: Remove comments from within multiline commands before sending them to qrhl-tool.
Date: Mon, 28 Nov 2022 07:59:30 -0500 (EST)

branch: elpa/proof-general
commit 3b5d65d340c74218e758066cad50e2b4433b3b5e
Author: Dominique Unruh <unruh@ut.ee>
Commit: Dominique Unruh <unruh@ut.ee>

    qrhl: Remove comments from within multiline commands before sending them to 
qrhl-tool.
---
 qrhl/qrhl.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/qrhl/qrhl.el b/qrhl/qrhl.el
index 84283387b4..262b2c1633 100644
--- a/qrhl/qrhl.el
+++ b/qrhl/qrhl.el
@@ -43,13 +43,13 @@
 
 (defun qrhl-forward-regex (regex)
   "If text starting at point matches REGEX, move to end of the match and 
return t. 
-   Otherwise return nil"
+Otherwise return nil"
   (and (looking-at regex) (goto-char (match-end 0)) t))
 
 (defun qrhl-parse-regular-command ()
   "Find the period-terminated command starting at point.
-   Moves to its end.
-   Returns t if this worked."
+Moves to its end.
+Returns t if this worked."
   (let ((pos
         (save-excursion
           (progn
@@ -101,6 +101,11 @@
            ))
   "Font-lock configuration for qRHL proof scripts")
 
+(defun qrhl-proof-script-preprocess (file start end cmd)
+  "Strips comments from the command CMD.
+Called before sending CMD to the prover."
+  (list (replace-regexp-in-string "\\(?:^\\|[ \t]\\)[ \t]*#.*$" "" cmd)))
+
 (proof-easy-config 'qrhl "qRHL"
   proof-prog-name qrhl-prog-name
   ;; We need to give some option here, otherwise `proof-prog-name' is
@@ -132,6 +137,7 @@
   proof-response-font-lock-keywords qrhl-font-lock-keywords
   font-lock-extra-managed-props '(display)
   proof-shell-unicode t
+  proof-script-preprocess #'qrhl-proof-script-preprocess
   )
 
 ; buttoning functions follow https://superuser.com/a/331896/748969



reply via email to

[Prev in Thread] Current Thread [Next in Thread]