[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bnf-mode a7df2dd 17/74: Fontify sequences
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bnf-mode a7df2dd 17/74: Fontify sequences |
Date: |
Thu, 9 May 2019 08:27:45 -0400 (EDT) |
branch: externals/bnf-mode
commit a7df2dd02281b58e73774cf40d2f795253517fa5
Author: Serghei Iakovlev <address@hidden>
Commit: Serghei Iakovlev <address@hidden>
Fontify sequences
---
bnf-mode.el | 10 ++++------
test/bnf-mode-font-test.el | 19 +++++++++++++++++++
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/bnf-mode.el b/bnf-mode.el
index 32e74ec..12550b4 100644
--- a/bnf-mode.el
+++ b/bnf-mode.el
@@ -165,16 +165,14 @@ See `rx' documentation for more information about REGEXPS
param."
"::="))
1 font-lock-function-name-face)
;; RHS nonterminals
- (,(bnf-rx (and "::="
- (1+ space)
+ (,(bnf-rx (and (1+ space)
"<"
(group rulename)
">"))
1 font-lock-builtin-face)
- ;; Regarding to RFC5234#2.1 angle brackets
- ;; (“<”, “>”) for RHS nonterminals are optional.
- (,(bnf-rx (and "::="
- (1+ space)
+ ;; Regarding to RFC5234#2.1 angle brackets
+ ;; (“<”, “>”) for RHS nonterminals are optional.
+ (,(bnf-rx (and (1+ space)
(group rulename)))
1 font-lock-builtin-face)
;; “may expand into” symbol
diff --git a/test/bnf-mode-font-test.el b/test/bnf-mode-font-test.el
index 23c5bd9..cfe18d2 100644
--- a/test/bnf-mode-font-test.el
+++ b/test/bnf-mode-font-test.el
@@ -114,6 +114,25 @@ angle-brackets ::= are-optional"
(should (eq (bnf-test-face-at 8)
'font-lock-function-name-face))
(should-not (bnf-test-face-at 9))))
+(ert-deftest bnf-mode-syntax-table/fontify-sequence ()
+ :tags '(fontification syntax-table)
+ (bnf-test-with-temp-buffer "rule ::= foo bar baz"
+ ;; “rule”
+ (should (eq (bnf-test-face-at 1)
'font-lock-function-name-face))
+ (should (eq (bnf-test-face-at 4)
'font-lock-function-name-face))
+ ;; “foo”
+ (should (eq (bnf-test-face-at 10)
'font-lock-builtin-face))
+ (should (eq (bnf-test-face-at 12)
'font-lock-builtin-face))
+ ;; space
+ (should-not (bnf-test-face-at 13))
+ ;; “bar”
+ (should (eq (bnf-test-face-at 14)
'font-lock-builtin-face))
+ (should (eq (bnf-test-face-at 16)
'font-lock-builtin-face))
+ ;; space
+ (should-not (bnf-test-face-at 17))
+ ;; “baz”
+ (should (eq (bnf-test-face-at 18)
'font-lock-builtin-face))
+ (should (eq (bnf-test-face-at 10)
'font-lock-builtin-face))))
(provide 'bnf-mode-font-test)
- [elpa] externals/bnf-mode 3e48f65 27/74: BNF has no strings. Treat ' and " as a symbols, (continued)
- [elpa] externals/bnf-mode 3e48f65 27/74: BNF has no strings. Treat ' and " as a symbols, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode a7ea867 32/74: Correct documentation, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 1ad5de5 37/74: Amended installation methods, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode b18b10c 05/74: Implemented font locking, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 388206f 09/74: Correct copyright date, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 3beded6 15/74: Rule names are case insensitive. Added test., Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode af8cf6d 18/74: Correct change log [ci skip], Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode fd83621 20/74: Bump version, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode f917836 23/74: Change default goal for make, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode ed24bee 21/74: Bumb version, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode a7df2dd 17/74: Fontify sequences,
Stefan Monnier <=
- [elpa] externals/bnf-mode defc412 11/74: Amended description and docs, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode aa2c7a2 30/74: Correct change log formatting [ci skip], Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode c90b14d 26/74: Correct documentation to follow code style guide., Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode a3a77e3 29/74: In the BNF there are no grouping brackets except angle ones. Fixed, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 1698dc8 39/74: Improved documentation, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 64a32ba 42/74: Cleaned up Makefile, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode a53ade1 24/74: Fixed BNF rule name definition to follow ALGOL 60 report, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 65bfadc 65/74: Fixed orthodox comments regexp, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode e2f8bfa 53/74: Added support of ; character to use in terminals, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 3a46f17 36/74: Correct documentation, Stefan Monnier, 2019/05/09