100
103
transpose = true;
102
105
} else if (sc.state == SCE_MATLAB_STRING) {
103
if (sc.ch == '\'' && sc.chPrev != '\\') {
107
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
110
} else if (sc.ch == '\'') {
104
111
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
106
113
} else if (sc.state == SCE_MATLAB_DOUBLEQUOTESTRING) {
107
if (sc.ch == '"' && sc.chPrev != '\\') {
115
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
118
} else if (sc.ch == '\"') {
108
119
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
110
121
} else if (sc.state == SCE_MATLAB_COMMENT || sc.state == SCE_MATLAB_COMMAND) {
117
128
if (sc.state == SCE_MATLAB_DEFAULT) {
118
129
if (IsCommentChar(sc.ch)) {
119
130
sc.SetState(SCE_MATLAB_COMMENT);
120
} else if (sc.ch == '!') {
131
} else if (sc.ch == '!' && sc.chNext != '=' ) {
121
132
sc.SetState(SCE_MATLAB_COMMAND);
122
133
} else if (sc.ch == '\'') {
126
137
sc.SetState(SCE_MATLAB_STRING);
128
139
} else if (sc.ch == '"') {
129
sc.SetState(SCE_MATLAB_DOUBLEQUOTESTRING);
140
sc.SetState(SCE_MATLAB_DOUBLEQUOTESTRING);
130
141
} else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) {
131
142
sc.SetState(SCE_MATLAB_NUMBER);
132
143
} else if (isalpha(sc.ch)) {
149
160
static void ColouriseMatlabDoc(unsigned int startPos, int length, int initStyle,
150
161
WordList *keywordlists[], Accessor &styler) {
151
ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar);
162
ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar);
154
165
static void ColouriseOctaveDoc(unsigned int startPos, int length, int initStyle,
155
166
WordList *keywordlists[], Accessor &styler) {
156
ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar);
167
ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar);
159
170
static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int,
160
WordList *[], Accessor &styler,
161
bool (*IsComment)(Accessor&,int,int)) {
171
WordList *[], Accessor &styler,
172
bool (*IsComment)(Accessor&, int, int)) {
163
174
int endPos = startPos + length;
203
214
static void FoldMatlabDoc(unsigned int startPos, int length, int initStyle,
204
215
WordList *keywordlists[], Accessor &styler) {
205
FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabComment);
216
FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabComment);
208
219
static void FoldOctaveDoc(unsigned int startPos, int length, int initStyle,
209
220
WordList *keywordlists[], Accessor &styler) {
210
FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveComment);
221
FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveComment);
213
224
static const char * const matlabWordListDesc[] = {