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

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

[nongnu] elpa/dart-mode 3082066 185/192: Don't font lock anchor in a str


From: ELPA Syncer
Subject: [nongnu] elpa/dart-mode 3082066 185/192: Don't font lock anchor in a string
Date: Sun, 29 Aug 2021 11:02:14 -0400 (EDT)

branch: elpa/dart-mode
commit 3082066d93ca9177fa42404cc50e98ddd6d56bf6
Author: Brady Trainor <mail@bradyt.net>
Commit: Brady Trainor <mail@bradyt.net>

    Don't font lock anchor in a string
---
 dart-mode.el | 5 +++--
 test/test.el | 9 +++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dart-mode.el b/dart-mode.el
index 445ee00..bdd8b2f 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -334,9 +334,10 @@ For example, \"height\" in \"const int height\" would be 
matched."
                            '("bool" "double" "dynamic" "int" "num" "void"
                              "var"
                              "get" "set")))
-          (set-match-data (list beg end))
           (goto-char end)
-          (throw 'result t))
+          (unless (nth 3 (syntax-ppss))
+            (set-match-data (list beg end))
+            (throw 'result t)))
         (goto-char (match-end 1)))
       (throw 'result nil))))
 
diff --git a/test/test.el b/test/test.el
index a6e1c84..d37bda1 100644
--- a/test/test.el
+++ b/test/test.el
@@ -34,3 +34,12 @@
 (ert-deftest dart-font-lock-named-constructors-test ()
   :expected-result :failed
   (should (dart-font-lock-test-apps "faceup/issues/named-constructors.dart")))
+
+(defun dart-font-lock-test (faceup)
+  (faceup-test-font-lock-string 'dart-mode faceup))
+(faceup-defexplainer dart-font-lock-test)
+
+(ert-deftest dart-font-lock-declared-identifier-anchors ()
+  "Simple Dart font-lock tests."
+  (should (dart-font-lock-test "«k:var» «v:a», «v:b»;"))
+  (should (dart-font-lock-test "group(«s:\"WordCount: Ignore special 
characters - \"», ignoreSpecialCharacters);")))



reply via email to

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