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

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

[elpa] externals/bnf-mode 3d5c4fd 30/36: Cleaned up comments syntax prop


From: Stefan Monnier
Subject: [elpa] externals/bnf-mode 3d5c4fd 30/36: Cleaned up comments syntax propertize for ALGOL 60 style
Date: Wed, 17 Mar 2021 18:40:19 -0400 (EDT)

branch: externals/bnf-mode
commit 3d5c4fd140526f52238c0fd60c82a590d538b84b
Author: Serghei Iakovlev <egrep@protonmail.ch>
Commit: Serghei Iakovlev <egrep@protonmail.ch>

    Cleaned up comments syntax propertize for ALGOL 60 style
---
 bnf-mode.el | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/bnf-mode.el b/bnf-mode.el
index e67ec27..6b54128 100644
--- a/bnf-mode.el
+++ b/bnf-mode.el
@@ -175,11 +175,9 @@ See `rx' documentation for more information about REGEXPS 
param."
     (modify-syntax-entry ?\> ")<" table)
 
     ;; Comments setup
-    (if bnf-mode-algol-comments-style
-        (modify-syntax-entry ?\; ">" table)
-      (progn
-        (modify-syntax-entry ?\; "<" table)
-        (modify-syntax-entry ?\n ">" table)))
+    (unless bnf-mode-algol-comments-style
+      (modify-syntax-entry ?\; "<" table)
+      (modify-syntax-entry ?\n ">" table))
 
     table)
   "Syntax table in use in `bnf-mode' buffers.")
@@ -187,8 +185,7 @@ See `rx' documentation for more information about REGEXPS 
param."
 (defconst bnf--syntax-propertize
   (syntax-propertize-rules
    ;; Fontify comments in ALGOL 60 style.
-   ("\\(?:begin\\s-+\\|;\\s-*\\)\\(comment\\)\\(;\\)" (1 "<") (2 ">"))
-   ("\\(?:begin\\s-+\\|;\\s-*\\)\\(comment\\)\\s-+[^;]*\\(;\\)" (1 "<") (2 
">")))
+   ("\\(?:begin\\s-+\\|;\\s-*\\)\\(comment\\)[^;]*\\(;\\)" (1 "<") (2 ">")))
   "Apply syntax table properties to special constructs.
 Provide a macro to apply syntax table properties to comments in ALGOL 60
 style.  Will be used only if `bnf-mode-algol-comments-style' is set to t.")



reply via email to

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