branch: externals/matlab-mode
commit c39c0c7514c9356623bd4d989d891b2da7c3ada0
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>
matlab-ts-mode: update to abi/14 b678301
---
matlab-ts-mode.el | 10 ++++--
.../font_lock_postfix_in_fcn_call_issue122.m | 7 ++++
..._lock_postfix_in_fcn_call_issue122_expected.txt | 7 ++++
.../font_lock_postfix_in_fcn_call_issue122.m | 7 ++++
..._lock_postfix_in_fcn_call_issue122_expected.txt | 40 ++++++++++++++++++++++
5 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/matlab-ts-mode.el b/matlab-ts-mode.el
index f73e23e554..6aa7150085 100644
--- a/matlab-ts-mode.el
+++ b/matlab-ts-mode.el
@@ -3277,8 +3277,14 @@ single quote string."
;; Case: string delimiter
;; double up if starting a new string => return nil
;; For: s = '
- ;; we have: (source_file
- ;; (ERROR (identifier) = '))
+ ;; we have: (source_file
+ ;; (ERROR (identifier) = (ERROR)))
+ ((string= "ERROR" type-back1)
+ nil)
+
+ ;; For: s = '
+ ;; We've also seen: (source_file
+ ;; (ERROR (identifier) = '))
((string= "'" type-back1)
(not (or (equal (treesit-node-type (treesit-node-prev-sibling
node-back1)) "ERROR")
(equal (treesit-node-type (treesit-node-parent node-back1))
"ERROR"))))
diff --git
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122.m
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122.m
new file mode 100644
index 0000000000..9e5e7b006c
--- /dev/null
+++
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122.m
@@ -0,0 +1,7 @@
+% -*- matlab-ts -*-
+
+C = [1 2; 3 4];
+V = [1 2];
+disp(C * (V.' + 1));
+disp(C * (V' + 1));
+
diff --git
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122_expected.txt
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122_expected.txt
new file mode 100644
index 0000000000..1ce4f63bba
--- /dev/null
+++
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122_expected.txt
@@ -0,0 +1,7 @@
+c ccc ccccccccc ccc
+
+v o bn nD n nbD
+v o bn nbD
+BBBBbd o bdoo o nbbD
+BBBBbd o bdo o nbbD
+
diff --git
a/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122.m
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122.m
new file mode 100644
index 0000000000..9e5e7b006c
--- /dev/null
+++
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122.m
@@ -0,0 +1,7 @@
+% -*- matlab-ts -*-
+
+C = [1 2; 3 4];
+V = [1 2];
+disp(C * (V.' + 1));
+disp(C * (V' + 1));
+
diff --git
a/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122_expected.txt
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122_expected.txt
new file mode 100644
index 0000000000..1d6326db85
--- /dev/null
+++
b/tests/test-matlab-ts-mode-parser-files/copy-of-test-matlab-ts-mode-font-lock-files/font_lock_postfix_in_fcn_call_issue122_expected.txt
@@ -0,0 +1,40 @@
+# -*- t-utils-ts-parse-tree -*-
+(source_file (comment[1,20]@{% -*- matlab-ts -*-}@)
+ (assignment left: (identifier[22,23]@{C}@) =[24,25]
+ right:
+ (matrix [[26,27]
+ (row (number[27,28]@{1}@) ,[29,29] (number[29,30]@{2}@))
+ ;[30,31]
+ (row (number[32,33]@{3}@) ,[34,34] (number[34,35]@{4}@))
+ ][35,36]))
+ ;[36,37]
+ (assignment left: (identifier[38,39]@{V}@) =[40,41]
+ right:
+ (matrix [[42,43]
+ (row (number[43,44]@{1}@) ,[45,45] (number[45,46]@{2}@))
+ ][46,47]))
+ ;[47,48]
+ (function_call name: (identifier[49,53]@{disp}@) ([53,54]
+ (arguments
+ argument:
+ (binary_operator left: (identifier[54,55]@{C}@) *[56,57]
+ right:
+ (parenthesis ([58,59]
+ (binary_operator
+ left: (postfix_operator operand: (identifier[59,60]@{V}@) .'[60,62])
+ +[63,64] right: (number[65,66]@{1}@))
+ )[66,67])))
+ )[67,68])
+ ;[68,69]
+ (function_call name: (identifier[70,74]@{disp}@) ([74,75]
+ (arguments
+ argument:
+ (binary_operator left: (identifier[75,76]@{C}@) *[77,78]
+ right:
+ (parenthesis ([79,80]
+ (binary_operator
+ left: (postfix_operator operand: (identifier[80,81]@{V}@) '[81,82])
+ +[83,84] right: (number[85,86]@{1}@))
+ )[86,87])))
+ )[87,88])
+ ;[88,89] \n[89,91])