[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bnf-mode 5856e25 29/36: Fixed comments recognition in A
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bnf-mode 5856e25 29/36: Fixed comments recognition in ALGOL 60 style |
Date: |
Wed, 17 Mar 2021 18:40:19 -0400 (EDT) |
branch: externals/bnf-mode
commit 5856e25c6873ac1d963c0af7fb354bbe61ce1a41
Author: Serghei Iakovlev <egrep@protonmail.ch>
Commit: Serghei Iakovlev <egrep@protonmail.ch>
Fixed comments recognition in ALGOL 60 style
---
NEWS | 9 +++++++++
bnf-mode.el | 3 ++-
test/test-bnf-mode-font-lock.el | 4 ++--
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/NEWS b/NEWS
index fb9d9fe..d8a19e9 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,15 @@ purposes. However, it seems `ert-runner' is semi-abandoned.
Thus,
tests were migrated to use more aggressively maintained test
framework calles `buttercup'.
+** Fixed comments recognition in ALGOL 60 style.
+Now, when `bnf-mode-algol-comments-style' is set to non-nil value
+the following line:
+ “begin comment Some text; Not a comment”
+will be correctly fontified as follows:
+ - “begin”: N/A
+ - “comment Some text;”: comment
+ - “Not a comment”: N/A
+
* BNF Mode 0.4.4
** Rework documentation and provide Info-file.
Previous releases of BNF Mode were bundled with incorrect “dir” file
diff --git a/bnf-mode.el b/bnf-mode.el
index 56b2be3..e67ec27 100644
--- a/bnf-mode.el
+++ b/bnf-mode.el
@@ -187,7 +187,8 @@ 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\\)\\(;\\|\\s-+[^;]*;\\)" (1 "<")))
+ ("\\(?:begin\\s-+\\|;\\s-*\\)\\(comment\\)\\(;\\)" (1 "<") (2 ">"))
+ ("\\(?:begin\\s-+\\|;\\s-*\\)\\(comment\\)\\s-+[^;]*\\(;\\)" (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.")
diff --git a/test/test-bnf-mode-font-lock.el b/test/test-bnf-mode-font-lock.el
index f4d677e..011e0e5 100644
--- a/test/test-bnf-mode-font-lock.el
+++ b/test/test-bnf-mode-font-lock.el
@@ -61,9 +61,9 @@
(it "fontifies line comments using ALGOL style"
(setq-default bnf-mode-algol-comments-style t)
- (expect "; comment here"
+ (expect "begin comment here ; not comment"
:to-be-fontified-as
- '(("; comment here" comment)))
+ '(("comment" comment ";" comment-delimiter)))
(setq-default bnf-mode-algol-comments-style nil))
(it "does not mix terminals and nonterminals"
- [elpa] externals/bnf-mode 2756c7c 26/36: Use default abbrev table provided by define-derived-mode, (continued)
- [elpa] externals/bnf-mode 2756c7c 26/36: Use default abbrev table provided by define-derived-mode, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode b9a8446 25/36: Refactor test to use shorten font lock helpers, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode d8cb802 27/36: Amended tests, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 27e45bd 31/36: Cleaned up syntax table, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode a4fe013 33/36: Bump version, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode e99dd39 35/36: Amended documentation, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 0f7ebc1 17/36: Move revision number to the common place, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 4d9ca0a 22/36: Updated documentation, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode e3489f3 24/36: Use years range in copyright notice, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 639628a 28/36: Added generic test suite, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode 5856e25 29/36: Fixed comments recognition in ALGOL 60 style,
Stefan Monnier <=
- [elpa] externals/bnf-mode 1e7e342 32/36: Removed support of ALGOL 60 style comments, Stefan Monnier, 2021/03/17
- [elpa] externals/bnf-mode d88eef6 36/36: Merge pull request #15 from sergeyklay/refactor-tests, Stefan Monnier, 2021/03/17