annotate src/qscintilla-4-matlab-end-op.patch @ 4406:ca55304a3cfd

qscintilla: patch for end keyword in places where is index * src/qscintilla-4-matlab-end-op.patch: new file * dist-files.mk: added qscintilla-4-matlab-end-op.patch
author John D
date Mon, 03 Jul 2017 09:23:08 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4406
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
1 diff -ur QScintilla_gpl-2.9.3.orig/lexers/LexMatlab.cpp QScintilla_gpl-2.9.3/lexers/LexMatlab.cpp
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
2 --- QScintilla_gpl-2.9.3.orig/lexers/LexMatlab.cpp 2017-06-26 15:15:10.807062925 -0400
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
3 +++ QScintilla_gpl-2.9.3/lexers/LexMatlab.cpp 2017-06-28 11:28:33.474725694 -0400
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
4 @@ -96,6 +96,9 @@
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
5 // of a string
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
6 bool transpose = false;
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
7
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
8 + // count for brackets for when 'end' could be an operator not a keyword
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
9 + int allow_end_op = 0;
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
10 +
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
11 // approximate position of first non space character in a line
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
12 int nonSpaceColumn = -1;
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
13 // approximate column position of the current character in a line
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
14 @@ -150,6 +153,9 @@
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
15 char s[100];
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
16 sc.GetCurrentLowered(s, sizeof(s));
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
17 if (keywords.InList(s)) {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
18 + if (strcmp ("end", s) == 0 && allow_end_op > 0) {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
19 + sc.ChangeState(SCE_MATLAB_NUMBER);
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
20 + }
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
21 sc.SetState(SCE_MATLAB_DEFAULT);
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
22 transpose = false;
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
23 } else {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
24 @@ -249,6 +255,12 @@
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
25 } else if (isalpha(sc.ch)) {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
26 sc.SetState(SCE_MATLAB_KEYWORD);
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
27 } else if (isoperator(static_cast<char>(sc.ch)) || sc.ch == '@' || sc.ch == '\\') {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
28 + if (sc.ch == '(' || sc.ch == '[' || sc.ch == '{') {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
29 + allow_end_op ++;
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
30 + } else if ((sc.ch == ')' || sc.ch == ']' || sc.ch == '}') && (allow_end_op > 0)) {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
31 + allow_end_op --;
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
32 + }
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
33 +
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
34 if (sc.ch == ')' || sc.ch == ']' || sc.ch == '}') {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
35 transpose = true;
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
36 } else {
ca55304a3cfd qscintilla: patch for end keyword in places where is index
John D
parents:
diff changeset
37 Only in QScintilla_gpl-2.9.3/lexers: .LexMatlab.cpp.swp