~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/sdk/wxscintilla/src/scintilla/src/LexMatlab.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "Scintilla.h"
26
26
#include "SciLexer.h"
27
27
 
 
28
#ifdef SCI_NAMESPACE
 
29
using namespace Scintilla;
 
30
#endif
28
31
 
29
32
static bool IsMatlabCommentChar(int c) {
30
33
        return (c == '%') ;
100
103
                                transpose = true;
101
104
                        }
102
105
                } else if (sc.state == SCE_MATLAB_STRING) {
103
 
                        if (sc.ch == '\'' && sc.chPrev != '\\') {
 
106
                        if (sc.ch == '\\') {
 
107
                                if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
 
108
                                        sc.Forward();
 
109
                                }
 
110
                        } else if (sc.ch == '\'') {
104
111
                                sc.ForwardSetState(SCE_MATLAB_DEFAULT);
105
112
                        }
106
113
                } else if (sc.state == SCE_MATLAB_DOUBLEQUOTESTRING) {
107
 
                        if (sc.ch == '"' && sc.chPrev != '\\') {
 
114
                        if (sc.ch == '\\') {
 
115
                                if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
 
116
                                        sc.Forward();
 
117
                                }
 
118
                        } else if (sc.ch == '\"') {
108
119
                                sc.ForwardSetState(SCE_MATLAB_DEFAULT);
109
120
                        }
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 == '\'') {
123
134
                                if (transpose) {
126
137
                                        sc.SetState(SCE_MATLAB_STRING);
127
138
                                }
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)) {
148
159
 
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);
152
163
}
153
164
 
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);
157
168
}
158
169
 
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)) {
162
173
 
163
174
        int endPos = startPos + length;
164
175
 
202
213
 
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);
206
217
}
207
218
 
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);
211
222
}
212
223
 
213
224
static const char * const matlabWordListDesc[] = {