annotate src/qscintilla-3-matlab-end-op.patch @ 4410:9b1f851080b6

qscitilla: update to 2.10.1 * src/qscintilla.mk: update version, checksum, use -std=c++11, use _qtX notation of lib names * src/qscintilla-1-fixes.patch: update patch * src/qscintilla-2-matlab-fold.patch: removed patch * src/qscintilla-3-matlab-block-comment.patch: update patch, rename => qscintilla-2-matlab-block-comment.patch * src/qscintilla-4-matlab-end-op.patch: update patch, rename => qscintilla-3-matlab-end-op.patch * dist-files.mk: add qscintilla-2-matlab-block-comment.patch, scintilla-3-matlab-end-op.patch, remove qscintilla-2-matlab-fold.patch qscintilla-4-matlab-end-op.patch qscintilla-3-matlab-block-comment.patch
author John D
date Mon, 10 Jul 2017 17:00:55 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4410
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
1 diff -ur QScintilla_gpl-2.10.1.orig/lexers/LexMatlab.cpp QScintilla_gpl-2.10.1/lexers/LexMatlab.cpp
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
2 --- QScintilla_gpl-2.10.1.orig/lexers/LexMatlab.cpp 2017-07-05 08:21:58.527158553 -0400
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
3 +++ QScintilla_gpl-2.10.1/lexers/LexMatlab.cpp 2017-07-05 08:22:26.304941561 -0400
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
4 @@ -97,6 +97,9 @@
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
5 // of a string
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
6 bool transpose = false;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
7
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
8 + // count for brackets for when 'end' could be an operator not a keyword
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
9 + int allow_end_op = 0;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
10 +
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
11 // approximate position of first non space character in a line
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
12 int nonSpaceColumn = -1;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
13 // approximate column position of the current character in a line
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
14 @@ -151,6 +154,9 @@
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
15 char s[100];
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
16 sc.GetCurrentLowered(s, sizeof(s));
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
17 if (keywords.InList(s)) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
18 + if (strcmp ("end", s) == 0 && allow_end_op > 0) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
19 + sc.ChangeState(SCE_MATLAB_NUMBER);
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
20 + }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
21 sc.SetState(SCE_MATLAB_DEFAULT);
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
22 transpose = false;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
23 } else {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
24 @@ -250,6 +256,12 @@
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
25 } else if (isalpha(sc.ch)) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
26 sc.SetState(SCE_MATLAB_KEYWORD);
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
27 } else if (isoperator(static_cast<char>(sc.ch)) || sc.ch == '@' || sc.ch == '\\') {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
28 + if (sc.ch == '(' || sc.ch == '[' || sc.ch == '{') {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
29 + allow_end_op ++;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
30 + } else if ((sc.ch == ')' || sc.ch == ']' || sc.ch == '}') && (allow_end_op > 0)) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
31 + allow_end_op --;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
32 + }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
33 +
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
34 if (sc.ch == ')' || sc.ch == ']' || sc.ch == '}') {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
35 transpose = true;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
36 } else {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
37 Only in QScintilla_gpl-2.10.1/lexers: LexMatlab.cpp.orig
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
38 Only in QScintilla_gpl-2.10.1/lexers: LexMatlab.cpp.rej