[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bnf-mode 3e48f65 27/74: BNF has no strings. Treat ' and
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bnf-mode 3e48f65 27/74: BNF has no strings. Treat ' and " as a symbols |
Date: |
Thu, 9 May 2019 08:27:47 -0400 (EDT) |
branch: externals/bnf-mode
commit 3e48f6520f5a1ec4bbb324a72adc2741ad16f24b
Author: Serghei Iakovlev <address@hidden>
Commit: Serghei Iakovlev <address@hidden>
BNF has no strings. Treat ' and " as a symbols
---
CHANGELOG.org | 3 +++
bnf-mode.el | 10 ++++++----
test/bnf-mode-font-test.el | 8 ++++++--
test/test-helper.el | 2 +-
4 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index c2fcffb..fb0f271 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -6,6 +6,9 @@ All notable changes to this project will be documented in this
file.
The format is based on [[http://keepachangelog.com][Keep a Changelog]] and
this project adheres to [[http://semver.org][Semantic Versioning]].
** [[https://github.com/sergeyklay/bnf-mode/compare/0.3.1...HEAD][Unreleased]]
+*** Fixed
+- Original BNF has no strings so treat ~'~ and ~"~ as a symbols
+
** [[https://github.com/sergeyklay/bnf-mode/compare/0.3.0...0.3.1][0.3.1]] -
2019-03-17
*** Fixed
- Fixed BNF rule name definition to follow
[[https://www.masswerk.at/algol60/report.htm][ALGOL 60 report]]
diff --git a/bnf-mode.el b/bnf-mode.el
index f078872..1c41ea0 100644
--- a/bnf-mode.el
+++ b/bnf-mode.el
@@ -4,7 +4,7 @@
;; Author: Serghei Iakovlev (concat "sadhooklay" "@" "gmail" ".com")
;; Maintainer: Serghei Iakovlev
-;; Version: 0.3.1
+;; Version: 0.3.2
;; URL: https://github.com/sergeyklay/bnf-mode
;; Keywords: languages
;; Package-Requires: ((cl-lib "0.5") (pkg-info "0.4") (emacs "24.3"))
@@ -187,9 +187,7 @@ See `rx' documentation for more information about REGEXPS
param."
(let ((table (make-syntax-table)))
;; Give CR the same syntax as newline
(modify-syntax-entry ?\^m "> b" table)
- ;; Characters used to delimit string constants
- (modify-syntax-entry ?\" "\"" table)
- ;; Comments setup (see RFC822#2.8)
+ ;; Comments setup
(modify-syntax-entry ?\; "<" table)
(modify-syntax-entry ?\n ">" table)
;; Treat ::= as sequence of symbols
@@ -197,6 +195,10 @@ See `rx' documentation for more information about REGEXPS
param."
(modify-syntax-entry ?\= "_" table)
;; Treat | as a symbol
(modify-syntax-entry ?\| "_" table)
+ ;; BNF has no strings so treat ' and "
+ ;; as a symbols
+ (modify-syntax-entry ?\" "_" table)
+ (modify-syntax-entry ?\' "_" table)
;; Group angle brackets
(modify-syntax-entry ?\< "(>" table)
(modify-syntax-entry ?\> ")<" table)
diff --git a/test/bnf-mode-font-test.el b/test/bnf-mode-font-test.el
index 727e147..02f1ac7 100644
--- a/test/bnf-mode-font-test.el
+++ b/test/bnf-mode-font-test.el
@@ -4,7 +4,7 @@
;; Author: Serghei Iakovlev (concat "sadhooklay" "@" "gmail" ".com")
;; Maintainer: Serghei Iakovlev
-;; Version: 0.3.1
+;; Version: 0.3.2
;; URL: https://github.com/sergeyklay/bnf-mode
;; This file is not part of GNU Emacs.
@@ -38,7 +38,11 @@
(ert-deftest bnf-mode-syntax-table/fontify-strings ()
:tags '(fontification syntax-table)
- (should (eq (bnf-test-face-at 11 "<foo> ::= \"bar\"")
'font-lock-string-face)))
+ (bnf-test-with-temp-buffer "<string delimers> ::= \" | ' | ` | ”"
+ (should-not (bnf-test-face-at 23))
+ (should-not (bnf-test-face-at 27))
+ (should-not (bnf-test-face-at 31))
+ (should-not (bnf-test-face-at 35))))
(ert-deftest bnf-mode-syntax-table/fontify-line-comment ()
:tags '(fontification syntax-table)
diff --git a/test/test-helper.el b/test/test-helper.el
index 6227629..6480f75 100644
--- a/test/test-helper.el
+++ b/test/test-helper.el
@@ -4,7 +4,7 @@
;; Author: Serghei Iakovlev (concat "sadhooklay" "@" "gmail" ".com")
;; Maintainer: Serghei Iakovlev
-;; Version: 0.3.1
+;; Version: 0.3.2
;; URL: https://github.com/sergeyklay/bnf-mode
;; This file is not part of GNU Emacs.
- [elpa] externals/bnf-mode cecdb79 01/74: Initial commit, (continued)
- [elpa] externals/bnf-mode cecdb79 01/74: Initial commit, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode f100f00 04/74: Initial font locking, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode f0a3cd7 03/74: Add CHANGELOG file, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode d3a7059 08/74: Added change log, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode aa8e9af 12/74: Initial test case, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode d50ded2 13/74: Amended tests, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 1d8c1e7 14/74: Update change log [ci skip], Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 7e37702 25/74: Correct BNF description [ci skip], Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode f6fd97b 07/74: Setup Travis CI builds, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 246a24f 22/74: Bump version, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 3e48f65 27/74: BNF has no strings. Treat ' and " as a symbols,
Stefan Monnier <=
- [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, 2019/05/09