branch: externals/matlab-mode
commit b30df4abb59f8981f8b1df287517b49a4a46af7d
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>
matlab-ts-mode: update to latest abi/14 matlab tree-sitter
https://github.com/acristoffers/tree-sitter-matlab/tree/50ea52363f2f97a8ef34af71a7f2b6f51a8020c6
---
matlab-ts-mode.el | 24 ++++++++++++----------
.../font_lock_class_issue55_abstract.skip.txt | 1 -
.../font_lock_class_issue55_abstract_expected.txt | 14 +++++++++++++
.../font_lock_class_issue55_subclass.skip.txt | 1 -
.../font_lock_class_issue55_subclass_expected.txt | 19 +++++++++++++++++
.../font_lock_error_issue56_end.skip.txt | 1 -
.../font_lock_error_issue56_end_expected.txt | 10 +++++++++
.../indent_old_indents.skip.txt | 2 ++
8 files changed, 58 insertions(+), 14 deletions(-)
diff --git a/matlab-ts-mode.el b/matlab-ts-mode.el
index 77e693aa03..a669cc9ac3 100644
--- a/matlab-ts-mode.el
+++ b/matlab-ts-mode.el
@@ -671,7 +671,19 @@ than the FILED-EXPRESSION-NODE start-point and end-point."
:override t
'(((comment) @matlab-ts-mode--comment-to-do-capture))
- ;; F-Rule: keywords: if, else, etc.
+ ;; F-Rule: Constant literal numbers, e.g. 1234, 12.34, 10e10
+ ;; We could use this for items like true, false, pi, etc. See some of these
numbers in:
+ ;;
https://www.mathworks.com/content/dam/mathworks/fact-sheet/matlab-basic-functions-reference.pdf
+ ;; however, they do show up as builtins, which to me seems more accurate.
+ ;; This rule needs to come before the "F-Rule: keyworks: if, else, end,
etc." because
+ ;; we want the end_keyword when used as a number index into a cell/matrix
to be a number font.
+ ;; See: tests/test-matlab-ts-mode-font-lock-files/font_lock_numbers.m
+ :language 'matlab
+ :feature 'number
+ '(((number) @matlab-ts-mode-number-face)
+ ((end_keyword) @matlab-ts-mode-end-number-face))
+
+ ;; F-Rule: keywords: if, else, end, etc.
;; See: tests/test-matlab-ts-mode-font-lock-files/font_lock_keywords.m
;; See: tests/test-matlab-ts-mode-font-lock-files/font_lock_class_methods.m
;; See: tests/test-matlab-ts-mode-font-lock-files/font_lock_keyword_spmd.m
@@ -792,16 +804,6 @@ than the FILED-EXPRESSION-NODE start-point and end-point."
t)
@font-lock-type-face)))
- ;; F-Rule: Constant literal numbers, e.g. 1234, 12.34, 10e10
- ;; We could use this for items like true, false, pi, etc. See some of these
numbers in:
- ;;
https://www.mathworks.com/content/dam/mathworks/fact-sheet/matlab-basic-functions-reference.pdf
- ;; however, they do show up as builtins, which to me seems more accurate.
- ;; See: tests/test-matlab-ts-mode-font-lock-files/font_lock_numbers.m
- :language 'matlab
- :feature 'number
- '(((number) @matlab-ts-mode-number-face)
- ((end_keyword) @matlab-ts-mode-end-number-face))
-
;; F-Rule: Brackets
;; See: tests/test-matlab-ts-mode-font-lock-files/font_lock_brackets.m
:language 'matlab
diff --git
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_abstract.skip.txt
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_abstract.skip.txt
deleted file mode 100644
index 327a54e455..0000000000
---
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_abstract.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-See https://github.com/acristoffers/tree-sitter-matlab/issues/55
diff --git
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_abstract_expected.txt
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_abstract_expected.txt
new file mode 100644
index 0000000000..e2711fc1c6
--- /dev/null
+++
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_abstract_expected.txt
@@ -0,0 +1,14 @@
+c ccc ccccccccc ccc
+
+c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+kkkkkkkk ffffffffffffffffffffffffffffffff
+ kkkkkkkkkkbttttttttb
+ PP
+ kkk
+
+ kkkkkkkbttttttttb
+ v o dbvvvbD
+ v o dbvvvbD
+ kkk
+kkk
diff --git
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_subclass.skip.txt
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_subclass.skip.txt
deleted file mode 100644
index 327a54e455..0000000000
---
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_subclass.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-See https://github.com/acristoffers/tree-sitter-matlab/issues/55
diff --git
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_subclass_expected.txt
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_subclass_expected.txt
new file mode 100644
index 0000000000..4d8c866dea
--- /dev/null
+++
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_class_issue55_subclass_expected.txt
@@ -0,0 +1,19 @@
+c ccc ccccccccc ccc
+
+c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+kkkkkkkk ffffffffffffffffffffffffffffffff o ffffffffffffffffffffffffffffffff
+ kkkkkkkkkk
+ PP o nn
+ kkk
+
+ kkkkkkk
+ kkkkkkkk v o fbvvvb
+ v o dddDdd o nnD
+ kkk
+
+ kkkkkkkk v o fbvvvb
+ v o dddDdd o nnD
+ kkk
+ kkk
+kkk
diff --git
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue56_end.skip.txt
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue56_end.skip.txt
deleted file mode 100644
index 8757953ef6..0000000000
---
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue56_end.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-See: https://github.com/acristoffers/tree-sitter-matlab/issues/56
diff --git
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue56_end_expected.txt
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue56_end_expected.txt
new file mode 100644
index 0000000000..2afa906ba6
--- /dev/null
+++
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue56_end_expected.txt
@@ -0,0 +1,10 @@
+c ccc ccccccccc ccc
+
+c cccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+
+v o nDnn
+v o dbnDbNNNonbb
+v o dbnDBBBbbNNNonbonbonb
+
+v o dbbn NNNbbD
diff --git a/tests/test-matlab-ts-mode-indent-files/indent_old_indents.skip.txt
b/tests/test-matlab-ts-mode-indent-files/indent_old_indents.skip.txt
new file mode 100644
index 0000000000..eeee8337cc
--- /dev/null
+++ b/tests/test-matlab-ts-mode-indent-files/indent_old_indents.skip.txt
@@ -0,0 +1,2 @@
+See https://github.com/acristoffers/tree-sitter-matlab/issues/53
+where myfcn({'str'}); is no longer parsed correctly