branch: externals/matlab-mode
commit 439cb85ebec8f0cfa6ab2dbd996168ecdcffb7cd
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>
t-utils-view-parse-tree: treat strings as regular text for font-lock
---
tests/t-utils.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/t-utils.el b/tests/t-utils.el
index f034af7ab5..daa29e1b32 100644
--- a/tests/t-utils.el
+++ b/tests/t-utils.el
@@ -2842,6 +2842,14 @@ nodes along with the text of the nodes. Regions are
clickable."
(insert "\n")
(buffer-string))))
+(defvar t-utils--ts-parse-tree-mode-syntax-table
+ (let ((table (make-syntax-table)))
+ ;; Treat strings as regular text
+ (modify-syntax-entry ?' "_" table)
+ (modify-syntax-entry ?\" "_" table)
+ table)
+ "Syntax table for `t-utils-ts-parse-tree-mode'.")
+
(defface t-utils-ts-parse-tree-code-face
'((t
:inherit default
@@ -2855,7 +2863,6 @@ nodes along with the text of the nodes. Regions are
clickable."
:underline t))
"Face used for [START,END] or <START,END> points in
t-utils-parse-tree-mode'.")
-
(defvar t-utils--ts-parse-tree-font-lock-keywords
(list
;; # comment lines. Note we don't use the syntax-table comment entries
because
@@ -2928,6 +2935,7 @@ nodes along with the text of the nodes. Regions are
clickable."
(define-derived-mode t-utils-ts-parse-tree-mode fundamental-mode
"ts-parse-tree" ()
"Major mode for treesit parse trees created by `t-utils--get-parse-tree'."
+ (set-syntax-table t-utils--ts-parse-tree-mode-syntax-table)
(setq-local font-lock-defaults '((t-utils--ts-parse-tree-font-lock-keywords)
nil nil nil))
(read-only-mode 1))