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

« back to all changes in this revision

Viewing changes to src/sdk/wxscintilla/src/scintilla/src/LexForth.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:
1
1
// Scintilla source code edit control
2
 
/** @file LexCrontab.cxx
3
 
 ** Lexer to use with extended crontab files used by a powerful
4
 
 ** Windows scheduler/event monitor/automation manager nnCron.
5
 
 ** (http://nemtsev.eserv.ru/)
 
2
/** @file LexForth.cxx
 
3
 ** Lexer for FORTH
6
4
 **/
7
 
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
 
5
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
8
6
// The License.txt file describes the conditions under which this software may be distributed.
9
7
 
10
8
#include <stdlib.h>
17
15
 
18
16
#include "PropSet.h"
19
17
#include "Accessor.h"
 
18
#include "StyleContext.h"
20
19
#include "KeyWords.h"
21
20
#include "Scintilla.h"
22
21
#include "SciLexer.h"
23
22
 
24
 
bool is_whitespace(int ch){
25
 
    return ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ';
26
 
}
27
 
 
28
 
bool is_blank(int ch){
29
 
    return ch == '\t' || ch == ' ';
30
 
}
31
 
//#define FORTH_DEBUG
32
 
#ifdef FORTH_DEBUG
33
 
static FILE *f_debug;
34
 
#define log(x)  fputs(f_debug,x);
35
 
#else
36
 
#define log(x)
37
 
#endif
38
 
 
39
 
#define STATE_LOCALE
40
 
#define BL ' '
41
 
 
42
 
static Accessor *st;
43
 
static int cur_pos,pos1,pos2,pos0,lengthDoc;
44
 
char *buffer;
45
 
 
46
 
char getChar(bool is_bl){
47
 
    char ch=st->SafeGetCharAt(cur_pos);
48
 
    if(is_bl) if(is_whitespace(ch)) ch=BL;
49
 
    return ch;
50
 
}
51
 
 
52
 
char getCharBL(){
53
 
    char ch=st->SafeGetCharAt(cur_pos);
54
 
    return ch;
55
 
}
56
 
bool is_eol(char ch){
57
 
    return ch=='\n' || ch=='\r';
58
 
}
59
 
 
60
 
int parse(char ch, bool skip_eol){
61
 
// pos1 - start pos of word
62
 
// pos2 - pos after of word
63
 
// pos0 - start pos
64
 
    char c=0;
65
 
    int len;
66
 
    bool is_bl=ch==BL;
67
 
    pos0=pos1=pos2=cur_pos;
68
 
    for(;cur_pos<lengthDoc && (c=getChar(is_bl))==ch; cur_pos++){
69
 
        if(is_eol(c) && !skip_eol){
70
 
            pos2=pos1;
71
 
            return 0;
72
 
        }
73
 
    }
74
 
    pos1=cur_pos;
75
 
    pos2=pos1;
76
 
    if(cur_pos==lengthDoc) return 0;
77
 
    for(len=0;cur_pos<lengthDoc && (c=getChar(is_bl))!=ch; cur_pos++){
78
 
        if(is_eol(c) && !skip_eol) break;
79
 
        pos2++;
80
 
        buffer[len++]=c;
81
 
    }
82
 
    if(c==ch) pos2--;
83
 
    buffer[len]='\0';
84
 
#ifdef FORTH_DEBUG
85
 
    fprintf(f_debug,"parse: %c %s\n",ch,buffer);
86
 
#endif
87
 
    return len;
88
 
}
89
 
 
90
 
bool _is_number(char *s,int base){
91
 
    for(;*s;s++){
92
 
        int digit=((int)*s)-(int)'0';
93
 
#ifdef FORTH_DEBUG
94
 
    fprintf(f_debug,"digit: %c %d\n",*s,digit);
95
 
#endif
96
 
        if(digit>9 && base>10) digit-=7;
97
 
        if(digit<0) return false;
98
 
        if(digit>=base) return false;
99
 
    }
100
 
    return true;
101
 
}
102
 
 
103
 
bool is_number(char *s){
104
 
    if(strncmp(s,"0x",2)==0) return _is_number(s+2,16);
105
 
    return _is_number(s,10);
106
 
}
107
 
 
108
 
static void ColouriseForthDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
109
 
{
110
 
    st=&styler;
111
 
    cur_pos=startPos;
112
 
    lengthDoc = startPos + length;
113
 
    buffer = new char[length];
114
 
 
115
 
#ifdef FORTH_DEBUG
116
 
    f_debug=fopen("c:\\sci.log","at");
117
 
#endif
 
23
#ifdef SCI_NAMESPACE
 
24
using namespace Scintilla;
 
25
#endif
 
26
 
 
27
static inline bool IsAWordChar(int ch) {
 
28
        return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
 
29
                ch == '_' || ch == '?' || ch == '"' || ch == '@' ||
 
30
                ch == '!' || ch == '[' || ch == ']' || ch == '/' ||
 
31
                ch == '+' || ch == '-' || ch == '*' || ch == '<' ||
 
32
                ch == '>' || ch == '=' || ch == ';' || ch == '(' ||
 
33
                ch == ')' );
 
34
}
 
35
 
 
36
static inline bool IsAWordStart(int ch) {
 
37
        return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
 
38
}
 
39
 
 
40
static inline bool IsANumChar(int ch) {
 
41
        return (ch < 0x80) && (isxdigit(ch) || ch == '.' || ch == 'e' || ch == 'E' );
 
42
}
 
43
 
 
44
static inline bool IsASpaceChar(int ch) {
 
45
        return (ch < 0x80) && isspace(ch);
 
46
}
 
47
 
 
48
static void ColouriseForthDoc(unsigned int startPos, int length, int initStyle, WordList *keywordLists[],
 
49
                            Accessor &styler) {
118
50
 
119
51
    WordList &control = *keywordLists[0];
120
52
    WordList &keyword = *keywordLists[1];
123
55
    WordList &preword2 = *keywordLists[4];
124
56
    WordList &strings = *keywordLists[5];
125
57
 
126
 
    // go through all provided text segment
127
 
    // using the hand-written state machine shown below
128
 
    styler.StartAt(startPos);
129
 
    styler.StartSegment(startPos);
130
 
    while(parse(BL,true)!=0){
131
 
        if(pos0!=pos1){
132
 
            styler.ColourTo(pos0,SCE_FORTH_DEFAULT);
133
 
            styler.ColourTo(pos1-1,SCE_FORTH_DEFAULT);
134
 
        }
135
 
        if(strcmp("\\",buffer)==0){
136
 
            styler.ColourTo(pos1,SCE_FORTH_COMMENT);
137
 
            parse(1,false);
138
 
            styler.ColourTo(pos2,SCE_FORTH_COMMENT);
139
 
        }else if(strcmp("(",buffer)==0){
140
 
            styler.ColourTo(pos1,SCE_FORTH_COMMENT);
141
 
            parse(')',true);
142
 
            if(cur_pos<lengthDoc) cur_pos++;
143
 
            styler.ColourTo(cur_pos,SCE_FORTH_COMMENT);
144
 
        }else if(strcmp("[",buffer)==0){
145
 
            styler.ColourTo(pos1,SCE_FORTH_STRING);
146
 
            parse(']',true);
147
 
            if(cur_pos<lengthDoc) cur_pos++;
148
 
            styler.ColourTo(cur_pos,SCE_FORTH_STRING);
149
 
        }else if(strcmp("{",buffer)==0){
150
 
            styler.ColourTo(pos1,SCE_FORTH_LOCALE);
151
 
            parse('}',false);
152
 
            if(cur_pos<lengthDoc) cur_pos++;
153
 
            styler.ColourTo(cur_pos,SCE_FORTH_LOCALE);
154
 
        }else if(strings.InList(buffer)) {
155
 
            styler.ColourTo(pos1,SCE_FORTH_STRING);
156
 
            parse('"',false);
157
 
            if(cur_pos<lengthDoc) cur_pos++;
158
 
            styler.ColourTo(cur_pos,SCE_FORTH_STRING);
159
 
        }else if(control.InList(buffer)) {
160
 
            styler.ColourTo(pos1,SCE_FORTH_CONTROL);
161
 
            styler.ColourTo(pos2,SCE_FORTH_CONTROL);
162
 
        }else if(keyword.InList(buffer)) {
163
 
            styler.ColourTo(pos1,SCE_FORTH_KEYWORD);
164
 
            styler.ColourTo(pos2,SCE_FORTH_KEYWORD);
165
 
        }else if(defword.InList(buffer)) {
166
 
            styler.ColourTo(pos1,SCE_FORTH_KEYWORD);
167
 
            styler.ColourTo(pos2,SCE_FORTH_KEYWORD);
168
 
            parse(BL,false);
169
 
            styler.ColourTo(pos1-1,SCE_FORTH_DEFAULT);
170
 
            styler.ColourTo(pos1,SCE_FORTH_DEFWORD);
171
 
            styler.ColourTo(pos2,SCE_FORTH_DEFWORD);
172
 
        }else if(preword1.InList(buffer)) {
173
 
            styler.ColourTo(pos1,SCE_FORTH_PREWORD1);
174
 
            parse(BL,false);
175
 
            styler.ColourTo(pos2,SCE_FORTH_PREWORD1);
176
 
        }else if(preword2.InList(buffer)) {
177
 
            styler.ColourTo(pos1,SCE_FORTH_PREWORD2);
178
 
            parse(BL,false);
179
 
            styler.ColourTo(pos2,SCE_FORTH_PREWORD2);
180
 
            parse(BL,false);
181
 
            styler.ColourTo(pos1,SCE_FORTH_STRING);
182
 
            styler.ColourTo(pos2,SCE_FORTH_STRING);
183
 
        }else if(is_number(buffer)){
184
 
            styler.ColourTo(pos1,SCE_FORTH_NUMBER);
185
 
            styler.ColourTo(pos2,SCE_FORTH_NUMBER);
186
 
        }
187
 
    }
188
 
#ifdef FORTH_DEBUG
189
 
    fclose(f_debug);
190
 
#endif
191
 
    delete []buffer;
192
 
    return;
193
 
/*
194
 
                        if(control.InList(buffer)) {
195
 
                            styler.ColourTo(i,SCE_FORTH_CONTROL);
196
 
                        } else if(keyword.InList(buffer)) {
197
 
                            styler.ColourTo(i-1,SCE_FORTH_KEYWORD );
198
 
                        } else if(defword.InList(buffer)) {
199
 
                            styler.ColourTo(i-1,SCE_FORTH_DEFWORD );
200
 
//                            prev_state=SCE_FORTH_DEFWORD
201
 
                        } else if(preword1.InList(buffer)) {
202
 
                            styler.ColourTo(i-1,SCE_FORTH_PREWORD1 );
203
 
//                            state=SCE_FORTH_PREWORD1;
204
 
                        } else if(preword2.InList(buffer)) {
205
 
                            styler.ColourTo(i-1,SCE_FORTH_PREWORD2 );
206
 
                         } else {
207
 
                            styler.ColourTo(i-1,SCE_FORTH_DEFAULT);
208
 
                        }
209
 
*/
210
 
/*
211
 
    chPrev=' ';
212
 
    for (int i = startPos; i < lengthDoc; i++) {
213
 
        char ch = chNext;
214
 
        chNext = styler.SafeGetCharAt(i + 1);
215
 
        if(i!=startPos) chPrev=styler.SafeGetCharAt(i - 1);
216
 
 
217
 
        if (styler.IsLeadByte(ch)) {
218
 
            chNext = styler.SafeGetCharAt(i + 2);
219
 
            i++;
220
 
            continue;
221
 
        }
222
 
#ifdef FORTH_DEBUG
223
 
        fprintf(f_debug,"%c %d ",ch,state);
224
 
#endif
225
 
        switch(state) {
226
 
            case SCE_FORTH_DEFAULT:
227
 
                if(is_whitespace(ch)) {
228
 
                    // whitespace is simply ignored here...
229
 
                    styler.ColourTo(i,SCE_FORTH_DEFAULT);
230
 
                    break;
231
 
                } else if( ch == '\\' && is_blank(chNext)) {
232
 
                    // signals the start of an one line comment...
233
 
                    state = SCE_FORTH_COMMENT;
234
 
                    styler.ColourTo(i,SCE_FORTH_COMMENT);
235
 
                } else if( is_whitespace(chPrev) &&  ch == '(' &&  is_whitespace(chNext)) {
236
 
                    // signals the start of a plain comment...
237
 
                    state = SCE_FORTH_COMMENT_ML;
238
 
                    styler.ColourTo(i,SCE_FORTH_COMMENT_ML);
239
 
                } else if( isdigit(ch) ) {
240
 
                    // signals the start of a number
241
 
                    bufferCount = 0;
242
 
                    buffer[bufferCount++] = ch;
243
 
                    state = SCE_FORTH_NUMBER;
244
 
                } else if( !is_whitespace(ch)) {
245
 
                    // signals the start of an identifier
246
 
                    bufferCount = 0;
247
 
                    buffer[bufferCount++] = ch;
248
 
                    state = SCE_FORTH_IDENTIFIER;
249
 
                } else {
250
 
                    // style it the default style..
251
 
                    styler.ColourTo(i,SCE_FORTH_DEFAULT);
252
 
                }
253
 
                break;
254
 
 
255
 
            case SCE_FORTH_COMMENT:
256
 
                // if we find a newline here,
257
 
                // we simply go to default state
258
 
                // else continue to work on it...
259
 
                if( ch == '\n' || ch == '\r' ) {
260
 
                    state = SCE_FORTH_DEFAULT;
261
 
                } else {
262
 
                    styler.ColourTo(i,SCE_FORTH_COMMENT);
263
 
                }
264
 
                break;
265
 
 
266
 
            case SCE_FORTH_COMMENT_ML:
267
 
                if( ch == ')') {
268
 
                    state = SCE_FORTH_DEFAULT;
269
 
                } else {
270
 
                    styler.ColourTo(i+1,SCE_FORTH_COMMENT_ML);
271
 
                }
272
 
                break;
273
 
 
274
 
            case SCE_FORTH_IDENTIFIER:
275
 
                // stay  in CONF_IDENTIFIER state until we find a non-alphanumeric
276
 
                if( !is_whitespace(ch) ) {
277
 
                    buffer[bufferCount++] = ch;
278
 
                } else {
279
 
                    state = SCE_FORTH_DEFAULT;
280
 
                    buffer[bufferCount] = '\0';
281
 
#ifdef FORTH_DEBUG
282
 
        fprintf(f_debug,"\nid %s\n",buffer);
283
 
#endif
284
 
 
285
 
                    // check if the buffer contains a keyword,
286
 
                    // and highlight it if it is a keyword...
287
 
//                    switch(prev_state)
288
 
//                    case SCE_FORTH_DEFAULT:
289
 
                        if(control.InList(buffer)) {
290
 
                            styler.ColourTo(i,SCE_FORTH_CONTROL);
291
 
                        } else if(keyword.InList(buffer)) {
292
 
                            styler.ColourTo(i-1,SCE_FORTH_KEYWORD );
293
 
                        } else if(defword.InList(buffer)) {
294
 
                            styler.ColourTo(i-1,SCE_FORTH_DEFWORD );
295
 
//                            prev_state=SCE_FORTH_DEFWORD
296
 
                        } else if(preword1.InList(buffer)) {
297
 
                            styler.ColourTo(i-1,SCE_FORTH_PREWORD1 );
298
 
//                            state=SCE_FORTH_PREWORD1;
299
 
                        } else if(preword2.InList(buffer)) {
300
 
                            styler.ColourTo(i-1,SCE_FORTH_PREWORD2 );
301
 
                         } else {
302
 
                            styler.ColourTo(i-1,SCE_FORTH_DEFAULT);
303
 
                        }
304
 
//                        break;
305
 
//                    case
306
 
 
307
 
                    // push back the faulty character
308
 
                    chNext = styler[i--];
309
 
                }
310
 
                break;
311
 
 
312
 
            case SCE_FORTH_NUMBER:
313
 
                // stay  in CONF_NUMBER state until we find a non-numeric
314
 
                if( isdigit(ch) ) {
315
 
                    buffer[bufferCount++] = ch;
316
 
                } else {
317
 
                    state = SCE_FORTH_DEFAULT;
318
 
                    buffer[bufferCount] = '\0';
319
 
                    // Colourize here... (normal number)
320
 
                    styler.ColourTo(i-1,SCE_FORTH_NUMBER);
321
 
                    // push back a character
322
 
                    chNext = styler[i--];
323
 
                }
324
 
                break;
325
 
        }
326
 
    }
327
 
#ifdef FORTH_DEBUG
328
 
    fclose(f_debug);
329
 
#endif
330
 
    delete []buffer;
331
 
*/
 
58
        StyleContext sc(startPos, length, initStyle, styler);
 
59
 
 
60
        for (; sc.More(); sc.Forward())
 
61
        {
 
62
                // Determine if the current state should terminate.
 
63
                if (sc.state == SCE_FORTH_COMMENT) {
 
64
                        if (sc.atLineEnd) {
 
65
                                sc.SetState(SCE_FORTH_DEFAULT);
 
66
                        }
 
67
                }else if (sc.state == SCE_FORTH_COMMENT_ML) {
 
68
                        if (sc.ch == ')') {
 
69
                                sc.ForwardSetState(SCE_FORTH_DEFAULT);
 
70
                        }
 
71
                }else if (sc.state == SCE_FORTH_IDENTIFIER || sc.state == SCE_FORTH_NUMBER) {
 
72
                        // handle numbers here too, because what we thought was a number might
 
73
                        // turn out to be a keyword e.g. 2DUP
 
74
                        if (IsASpaceChar(sc.ch) ) {
 
75
                                char s[100];
 
76
                                sc.GetCurrentLowered(s, sizeof(s));
 
77
                                int newState = sc.state == SCE_FORTH_NUMBER ? SCE_FORTH_NUMBER : SCE_FORTH_DEFAULT;
 
78
                                if (control.InList(s)) {
 
79
                                        sc.ChangeState(SCE_FORTH_CONTROL);
 
80
                                } else if (keyword.InList(s)) {
 
81
                                        sc.ChangeState(SCE_FORTH_KEYWORD);
 
82
                                } else if (defword.InList(s)) {
 
83
                                        sc.ChangeState(SCE_FORTH_DEFWORD);
 
84
                                }  else if (preword1.InList(s)) {
 
85
                                        sc.ChangeState(SCE_FORTH_PREWORD1);
 
86
                                } else if (preword2.InList(s)) {
 
87
                                        sc.ChangeState(SCE_FORTH_PREWORD2);
 
88
                                } else if (strings.InList(s)) {
 
89
                                        sc.ChangeState(SCE_FORTH_STRING);
 
90
                                        newState = SCE_FORTH_STRING;
 
91
                                }
 
92
                                sc.SetState(newState);
 
93
                        }
 
94
                        if (sc.state == SCE_FORTH_NUMBER) {
 
95
                                if (IsASpaceChar(sc.ch)) {
 
96
                                        sc.SetState(SCE_FORTH_DEFAULT);
 
97
                                } else if (!IsANumChar(sc.ch)) {
 
98
                                        sc.ChangeState(SCE_FORTH_IDENTIFIER);
 
99
                                }
 
100
                        }
 
101
                }else if (sc.state == SCE_FORTH_STRING) {
 
102
                        if (sc.ch == '\"') {
 
103
                                sc.ForwardSetState(SCE_FORTH_DEFAULT);
 
104
                        }
 
105
                }else if (sc.state == SCE_FORTH_LOCALE) {
 
106
                        if (sc.ch == '}') {
 
107
                                sc.ForwardSetState(SCE_FORTH_DEFAULT);
 
108
                        }
 
109
                }else if (sc.state == SCE_FORTH_DEFWORD) {
 
110
                        if (IsASpaceChar(sc.ch)) {
 
111
                                sc.SetState(SCE_FORTH_DEFAULT);
 
112
                        }
 
113
                }
 
114
 
 
115
                // Determine if a new state should be entered.
 
116
                if (sc.state == SCE_FORTH_DEFAULT) {
 
117
                        if (sc.ch == '\\'){
 
118
                                sc.SetState(SCE_FORTH_COMMENT);
 
119
                        } else if (sc.ch == '(' &&
 
120
                                        (sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
 
121
                                        (sc.atLineEnd   || IsASpaceChar(sc.chNext))) {
 
122
                                sc.SetState(SCE_FORTH_COMMENT_ML);
 
123
                        } else if (     (sc.ch == '$' && (isascii(sc.chNext) && isxdigit(sc.chNext))) ) {
 
124
                                // number starting with $ is a hex number
 
125
                                sc.SetState(SCE_FORTH_NUMBER);
 
126
                                while(sc.More() && isascii(sc.chNext) && isxdigit(sc.chNext))
 
127
                                        sc.Forward();
 
128
                        } else if ( (sc.ch == '%' && (isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) {
 
129
                                // number starting with % is binary
 
130
                                sc.SetState(SCE_FORTH_NUMBER);
 
131
                                while(sc.More() && isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))
 
132
                                        sc.Forward();
 
133
                        } else if (     isascii(sc.ch) && 
 
134
                                                (isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && isascii(sc.chNext) && isxdigit(sc.chNext)) )
 
135
                                        ){
 
136
                                sc.SetState(SCE_FORTH_NUMBER);
 
137
                        } else if (IsAWordStart(sc.ch)) {
 
138
                                sc.SetState(SCE_FORTH_IDENTIFIER);
 
139
                        } else if (sc.ch == '{') {
 
140
                                sc.SetState(SCE_FORTH_LOCALE);
 
141
                        } else if (sc.ch == ':' && isascii(sc.chNext) && isspace(sc.chNext)) {
 
142
                                // highlight word definitions e.g.  : GCD ( n n -- n ) ..... ;
 
143
                                //                                  ^ ^^^
 
144
                                sc.SetState(SCE_FORTH_DEFWORD);
 
145
                                while(sc.More() && isascii(sc.chNext) && isspace(sc.chNext))
 
146
                                        sc.Forward();
 
147
                        } else if (sc.ch == ';' &&
 
148
                                        (sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
 
149
                                        (sc.atLineEnd   || IsASpaceChar(sc.chNext))     ) {
 
150
                                // mark the ';' that ends a word
 
151
                                sc.SetState(SCE_FORTH_DEFWORD);
 
152
                                sc.ForwardSetState(SCE_FORTH_DEFAULT);
 
153
                        }
 
154
                }
 
155
 
 
156
        }
 
157
        sc.Complete();
332
158
}
333
159
 
334
160
static void FoldForthDoc(unsigned int, int, int, WordList *[],
335
 
                       Accessor &) {
 
161
                                                Accessor &) {
336
162
}
337
163
 
338
164
static const char * const forthWordLists[] = {
339
 
            "control keywords",
340
 
            "keywords",
341
 
            "definition words",
342
 
            "prewords with one argument",
343
 
            "prewords with two arguments",
344
 
            "string definition keywords",
345
 
            0,
346
 
        };
347
 
 
348
 
LexerModule lmForth(SCLEX_FORTH, ColouriseForthDoc, "forth",FoldForthDoc,forthWordLists);
 
165
                        "control keywords",
 
166
                        "keywords",
 
167
                        "definition words",
 
168
                        "prewords with one argument",
 
169
                        "prewords with two arguments",
 
170
                        "string definition keywords",
 
171
                        0,
 
172
                };
 
173
 
 
174
LexerModule lmForth(SCLEX_FORTH, ColouriseForthDoc, "forth", FoldForthDoc, forthWordLists);
 
175
 
 
176