[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 56cba29 194/217: Fix bad syntax when `*/` is pr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 56cba29 194/217: Fix bad syntax when `*/` is prefixed by an opcode. (#143) |
Date: |
Sun, 29 Aug 2021 11:31:11 -0400 (EDT) |
branch: elpa/scala-mode
commit 56cba2903cf6e12c715dbb5c99b34c97b2679379
Author: David Strawn <isomarcte@gmail.com>
Commit: Sam Halliday <sam.halliday@gmail.com>
Fix bad syntax when `*/` is prefixed by an opcode. (#143)
When `*/` is prefixed by one or more members of `scala-syntax:opchar-group`
(`[#:<=>@!%&*+/?\\\\^|~-]`), the `scala-syntax:propertize-special-symbols`
function incorrectly marks all the characters as symbol values. This causes the
`*/` not to be recognized as a comment terminator.
This commit corrects the issue by adding an exclusion to the
`scala-syntax:propertize-special-symbols` function if the `match` value has a
suffix of `*/`.
A concrete example can be viewed at
https://github.com/scala/scala/blob/v2.11.11/src/reflect/scala/reflect/internal/Symbols.scala#L863
.
---
scala-mode-syntax.el | 1 +
test/scala-mode-test.el | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/scala-mode-syntax.el b/scala-mode-syntax.el
index 3535d89..fc8b68e 100644
--- a/scala-mode-syntax.el
+++ b/scala-mode-syntax.el
@@ -605,6 +605,7 @@ symbol constituents (syntax 3)."
(match-end (match-end 0))
(match (match-string 0)))
(unless (or
+ (string-suffix-p "*/" match)
(member match '("</"))
(member 0 (mapcar (lambda (regexp) (string-match regexp
match)) '("^*+/$" "^//.*$" "^/\\*+$")))
(equal 2 (syntax-class (syntax-after match-end)))
diff --git a/test/scala-mode-test.el b/test/scala-mode-test.el
index d729cd1..8a7a195 100644
--- a/test/scala-mode-test.el
+++ b/test/scala-mode-test.el
@@ -166,3 +166,13 @@ object Ensime {
"val c = s\"${sum.getOrElse(\"\")} - $sum\""
"22202010271422212222222224775501012227"
"KKK-V-K--SSSSSSSSSSSSSSSSSSSSSSSSSSSSS"))
+
+(ert-deftest smt:syntax-class-and-font-lock-test-23 ()
+ "Test that `[!%&*+/?\\\\^|~-#:<=>@]\*/` will be treated as punctuation and
+_not_ a symbol. Doing so would cause comment strings such as `/* Comment &*/`
to
+not be recognized as a delimiter, causing the entire file to treated as a
+comment. A concrete example may be viewed at
https://github.com/scala/scala/blob/v2.11.11/src/reflect/scala/reflect/internal/Symbols.scala#L863"
+ (smt:test
+ "/* &*/"
+ "110111"
+ "DDDOOO"))
- [nongnu] elpa/scala-mode d8a141b 125/217: Makefile clean-up, (continued)
- [nongnu] elpa/scala-mode d8a141b 125/217: Makefile clean-up, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 34888c0 142/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f03a582 141/217: Merge pull request #83 from ancane/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 461f9a5 134/217: Fix issue #63 and names with _ and reserved word, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ababc73 151/217: remove interactive, update filename., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 27efa44 019/217: updated README, added LICENSE, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d6f8cee 135/217: scala 2.10 preamble, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 03cfbe4 148/217: Add types to index items., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ed645d2 153/217: move create index function for imenu to big setq with everything else., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 618f0fb 163/217: remove 'scala-indent:indent-on-parentheses in preference of smartparens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 56cba29 194/217: Fix bad syntax when `*/` is prefixed by an opcode. (#143),
ELPA Syncer <=
- [nongnu] elpa/scala-mode a1ff6f3 202/217: feat: add Scala 3 keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 46bb948 198/217: Fix #155, remove ob-scala.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a2a1b1d 208/217: compile mode with sbt thin client, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 54fa36f 200/217: Merge pull request #159 from kpbochenek/fix-files-association-alist, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 5058a85 204/217: doc: clarify Scala versions supported, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0c5ed9e 022/217: deleted example files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 61a511f 021/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode fe5c2c4 031/217: Fixes #11: was still using the slow regexp, not faster, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 1a3d958 029/217: forward/backward-sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e30b35a 008/217: Indentation working, ELPA Syncer, 2021/08/29