Compared files  

Left
C:\SDK\wxWidgets-2.6.2\contrib\src\stc\scintilla\src\LexAU3.cxx
Last modified2005-03-21 12:17:54.000 +0100
Size20 Kb (615 Lines)
EncodingLatin 1 - ANSI (CP1252) default
Right
C:\SDK\wxWidgets-2.6.3\contrib\src\stc\scintilla\src\LexAU3.cxx
Last modified2006-03-16 13:07:06.001 +0100
Size27 Kb (847 Lines)
EncodingLatin 1 - ANSI (CP1252) default


   Comparison Statistics  

Detailed Statistics

All Changes
 BlocksLines
Unchanged31561
Inserted763
Deleted126
Ignored00
Changed22251



   Comparison Details  

24 skipped lines
25 25 //                  Added fold.compact support set with fold.compact=1
26 26 //                  Changed folding inside of #cs-#ce. Default is no keyword folding inside comment blocks when fold.comment=1
27 27 //                        it will now only happen when fold.comment=2.
28 //  28 // Sep 5, 2004    - Added logic to handle colourizing words on the last line. 
  29 //                        Typed Characters now show as "default" till they match any table.
  30 // Oct 10, 2004   - Added logic to show Comments in "Special" directives
  31 // Nov  1, 2004   - Added better testing for Numbers supporting x and e notation.
  32 // Nov 28, 2004   - Added logic to handle continuation lines for syntax highlighting.
  33 // Jan 10, 2005   - Added Abbreviations Keyword used for expansion
  34 // Mar 24, 2005   - Updated Abbreviations Keywords to fix when followed by Operator.
  35 // Apr 18, 2005   - Updated #CE/#Comment-End logic to take a linecomment ";" into account
  36 //                - Added folding support for With...EndWith
  37 //                - Added support for a DOT in variable names
  38 //                - Fixed Underscore in CommentBlock
  39 // May 23, 2005   - Fixed the SentKey lexing in case of a missing }
  40 // Aug 11, 2005   - Fixed possible bug with s_save length > 100.
  41 // Aug 23, 2005   - Added Switch/endswitch support to the folding logic.
  42 //
29 43 // Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org>
30 44 // The License.txt file describes the conditions under which this software may be distributed.
31 45 // Scintilla source code edit control
24 skipped lines
56 70  
57 71 static inline bool IsAWordStart(const int ch)
58 72 {
59     return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$'); 73     return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$' || ch == '.');
60 74 }
61 75  
62 76 static inline bool IsAOperator(char ch) {
25 skipped lines
88 102     // split the portion of the sendkey in the part before and after the spaces
89 103     while ( ( (cTemp = szLine[nPos]) != '\0'))
90 104     {
  105         // skip leading Ctrl/Shift/ALt state
  106         if ((cTemp == '#' || cTemp == '!' || cTemp == '^') && (szLine[nPos+1] == '{') ) 
  107         {
  108         } 
91         if ((cTemp == ') && (nFlag == 0) ) // get the stuff till first space 109         else if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space
92 110         {
93 111         nFlag = 1;
94 112         // Add } to the end of the first bit for table lookup later.
37 skipped lines
132 150  
133 151 } // GetSendKey() 
134 152  
  153 //
  154 // Routine to check the last "none comment" character on a line to see if its a continuation
  155 // 
  156 static bool IsContinuationLine(unsigned int szLine, Accessor &styler)
  157 {
18 skipped lines
  176     return false;
  177 } // IsContinuationLine()
  178  
  179 //
  180 // syntax highlighting logic
135 181 static void ColouriseAU3Doc(unsigned int startPos, 
136 182         int length, int initStyle,
137 183         WordList *keywordlists[],
5 skipped lines
143 189     WordList &keywords4 = *keywordlists[3];
144 190     WordList &keywords5 = *keywordlists[4];
145 191     WordList &keywords6 = *keywordlists[5];
  192     WordList &keywords7 = *keywordlists[6];
  193     // find the first previous line without continuation character at the end
  194     int lineCurrent = styler.GetLine(startPos);
  195     int s_startPos = startPos;
  196     // When not inside a Block comment: find First line without _
5 skipped lines
  202         initStyle =  0;                           // reset the start style to 0 
  203         }
  204     }
  205     // Set the new length to include it from the start and set the start position
  206     length = length + s_startPos - startPos;      // correct the total length to process
146 207     styler.StartAt(startPos);
147   208      
148 209     StyleContext sc(startPos, length, initStyle, styler);
149 210     char si;     // string indicator "=1 '=2
  211     char ni;     // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 Enot=3
  212     char ci;     // comment indicator 0=not linecomment(;) 
  213     char s_save[100];
150     si=0; 214     si=0;  
  215     ni=0;
  216     ci=0;
151 217     //$$$
152 218     for (; sc.More(); sc.Forward()) {
153 219         char s[100];
154 220         sc.GetCurrentLowered(s, sizeof(s));
  221         // **********************************************
  222         // save the total current word for eof processing 
  223         if (IsAWordChar(sc.ch) || sc.ch == '}') 
  224         {
  225         strcpy(s_save,s);
3 skipped lines
  229         s_save[tp+1] = '\0';
  230         }
  231         }
  232         // **********************************************
  233         //
155 234         switch (sc.state)
156 235         {
157 236             case SCE_AU3_COMMENTBLOCK:
158 237             {
  238         //Reset at line end
  239         if (sc.atLineEnd) {
  240         ci=0;
  241         sc.SetState(SCE_AU3_COMMENTBLOCK);
  242         }
  243         //skip rest of line when a ; is encountered
  244         if (sc.chPrev == ';') {
  245         ci=2;
  246         sc.SetState(SCE_AU3_COMMENTBLOCK);
  247         }
  248         // skip rest of the line
  249         if (ci==2) 
  250         break;
  251         // check when first character is detected on the lin
  252         if (ci==0) {
  253         if (IsAWordStart(static_cast<char>(sc.ch)) || IsAOperator(static_cast<char>(sc.ch))) {
  254         ci=1;
  255         sc.SetState(SCE_AU3_COMMENTBLOCK);
  256         }
  257         break;
  258         }
159         if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) 259         if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) {
160         {  
161 260         if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0)) 
162         {sc.SetState(SCE_AU3_COMMENT);}  // set to comment line for the rest of the line 261         sc.SetState(SCE_AU3_COMMENT);  // set to comment line for the rest of the line
163 262         else
164         {sc.SetState(SCE_AU3_COMMENTBLOCK);} 263         ci=2;  // line doesn't begin with #CE so skip the rest of the line
165 264         }
166 265                 break;
167 266         }
4 skipped lines
172 271             }
173 272             case SCE_AU3_OPERATOR:
174 273             {
  274                 // check if its a COMobject 
  275         if (sc.chPrev == '.' && IsAWordChar(sc.ch)) {
  276         sc.SetState(SCE_AU3_COMOBJ);
  277         } 
  278         else {
175                 sc.SetState(SCE_AU3_DEFAULT); 279         sc.SetState(SCE_AU3_DEFAULT);
  280         }
176 281                 break;
177 282             }
178 283             case SCE_AU3_SPECIAL:
179 284             {
  285                 if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);}
180                 if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} 286         if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);}
181 287                 break;
182 288             }
183 289             case SCE_AU3_KEYWORD:
31 skipped lines
215 321         sc.ChangeState(SCE_AU3_SPECIAL);
216 322         sc.SetState(SCE_AU3_SPECIAL);
217 323         }
  324         else if ((keywords7.InList(s)) && (!IsAOperator(static_cast<char>(sc.ch)))) {
  325         sc.ChangeState(SCE_AU3_EXPAND);
  326         sc.SetState(SCE_AU3_DEFAULT);
  327         }
218 328         else if (strcmp(s, "_") == 0) {
219 329         sc.ChangeState(SCE_AU3_OPERATOR);
220 330         sc.SetState(SCE_AU3_DEFAULT);
4 skipped lines
225 335         }
226 336         }
227 337         } 
  338                 if (sc.atLineEnd) {
228                 if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} 339         sc.SetState(SCE_AU3_DEFAULT);}
229 340                 break;
230 341             }
231             case SCE_AU3_NUMBER: 342         case SCE_AU3_NUMBER:
232 343             {
  344         // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 E-not=3
  345         //
  346         // test for Hex notation
  347         if (strcmp(s, "0") == 0 && (sc.ch == 'x' || sc.ch == 'X') && ni == 0)
  348         {
  349         ni = 2;
  350         break;
  351         }
  352         // test for E notation
  353         if (IsADigit(sc.chPrev) && (sc.ch == 'e' || sc.ch == 'E') && ni <= 1)
32 skipped lines
  386         }
  387         break;
  388         }
  389         case SCE_AU3_VARIABLE:
  390         {
  391         // Check if its a COMObject
  392         if (sc.ch == '.' && !IsADigit(sc.chNext)) {
  393         sc.SetState(SCE_AU3_OPERATOR);
  394         }
  395         else if (!IsAWordChar(sc.ch)) {
233                 if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_AU3_DEFAULT);} 396         sc.SetState(SCE_AU3_DEFAULT);
  397         }
234                 break; 398         break;
235 399             }
236             case SCE_AU3_VARIABLE: 400         case SCE_AU3_COMOBJ:
237             { 401         {
  402         if (!(IsAWordChar(sc.ch))) {
238                 if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_AU3_DEFAULT);} 403         sc.SetState(SCE_AU3_DEFAULT);
  404         }
239                 break; 405         break;
240 406             }
241 407             case SCE_AU3_STRING:
242 408             {
3 skipped lines
246 412         {
247 413         sc.ForwardSetState(SCE_AU3_DEFAULT);
248 414         }
  415                 if (sc.atLineEnd)
  416         {
  417         // at line end and not found a continuation char then reset to default
  418         int lineCurrent = styler.GetLine(sc.currentPos);
  419         if (!IsContinuationLine(lineCurrent,styler)) 
  420         {
249                 if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} 421         sc.SetState(SCE_AU3_DEFAULT);
  422         }
  423         }
250 424         // find Sendkeys in a STRING
251 425         if (sc.ch == '{') {sc.SetState(SCE_AU3_SENT);}
252 426         if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
35 skipped lines
288 462         // check if next portion is again a sendkey
289 463         if (sc.atLineEnd) 
290 464         {
  465         sc.ChangeState(SCE_AU3_STRING);
291 466         sc.SetState(SCE_AU3_DEFAULT);
292 467         si = 0;  // reset string indicator
293 468         }
294         if (sc.ch == '{' && sc.chPrev != '{') {sc.SetState(SCE_AU3_SENT);} 469         //if (sc.ch == '{' && sc.chPrev != '{') {sc.SetState(SCE_AU3_SENT);}
295 470         if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
296 471         if (sc.ch == '!' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
297 472         if (sc.ch == '^' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
16 skipped lines
314 489             if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);}
315 490             else if (sc.ch == '#') {sc.SetState(SCE_AU3_KEYWORD);}
316 491             else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);}
  492             else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);}
317 493             else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);}
318 494             else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);}  // string after #include 
319 495             else if (sc.ch == '\"') {
2 skipped lines
322 498             else if (sc.ch == '\'') {
323 499         sc.SetState(SCE_AU3_STRING);
324 500         si = 2;   }
325             else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {sc.SetState(SCE_AU3_NUMBER);} 501             else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) 
  502         {
  503         sc.SetState(SCE_AU3_NUMBER);
  504         ni = 0;
  505         }
326 506             else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_AU3_KEYWORD);}
327 507             else if (IsAOperator(static_cast<char>(sc.ch))) {sc.SetState(SCE_AU3_OPERATOR);}
328 508         else if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);}
329 509         }
330 510     }      //for (; sc.More(); sc.Forward())
  511  
  512     //*************************************
  513     // Colourize the last word correctly 
  514     //*************************************
  515     if (sc.state == SCE_AU3_KEYWORD)
  516         {
  517         if (strcmp(s_save, "#cs")== 0 || strcmp(s_save, "#comments-start")== 0 )
  518         {
  519         sc.ChangeState(SCE_AU3_COMMENTBLOCK);
  520         sc.SetState(SCE_AU3_COMMENTBLOCK);
57 skipped lines
  578         sc.SetState(SCE_AU3_STRING);
  579         }
  580         // check if next portion is again a sendkey
  581         if (sc.atLineEnd) 
  582         {
  583         sc.ChangeState(SCE_AU3_STRING);
  584         sc.SetState(SCE_AU3_DEFAULT);
  585         }
  586     }
  587     //*************************************
331     sc.Complete(); 588     sc.Complete();
332 589 }
333 590  
334 591 //
17 skipped lines
352 609  
353 610 } // GetStyleFirstWord()
354 611  
355 //  
356 // Routine to check the last "none comment" character on a line to see if its a continuation  
357 //   
358 static bool IsContinuationLine(unsigned int szLine, Accessor &styler)  
359 {  
16 skipped lines
376         nePos--; // skip to next char  
377     } // End While  
378     return false;  
379 } // IsContinuationLine()  
380    
381 612  
382 613 //
383 614 static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
112 skipped lines
496 727         // create new fold for these words 
497 728         if (strcmp(szKeyword,"do") == 0   || strcmp(szKeyword,"for") == 0 ||
498 729         strcmp(szKeyword,"func") == 0 || strcmp(szKeyword,"while") == 0||
499         strcmp(szKeyword,"#region") == 0 ) { 730         strcmp(szKeyword,"with") == 0 || strcmp(szKeyword,"#region") == 0 ) {
500 731         levelNext++;
501 732         }
502         // create double Fold for select because Case will subtract one of the current level 733         // create double Fold for select&switch because Case will subtract one of the current level
503         if (strcmp(szKeyword,"select") == 0) { 734         if (strcmp(szKeyword,"select") == 0 || strcmp(szKeyword,"switch") == 0) {
504 735         levelNext++;
505 736         levelNext++;
506 737         }
507 738         // end the fold for these words before the current line
508 739         if (strcmp(szKeyword,"endfunc") == 0 || strcmp(szKeyword,"endif") == 0 ||
509 740         strcmp(szKeyword,"next") == 0    || strcmp(szKeyword,"until") == 0 || 
510         strcmp(szKeyword,"wend") == 0){ 741         strcmp(szKeyword,"endwith") == 0 ||strcmp(szKeyword,"wend") == 0){
511 742         levelNext--;
512 743         levelCurrent--;
513 744         }
3 skipped lines
517 748         levelCurrent--;
518 749         }
519 750         // end the double fold for this word before the current line
520         if (strcmp(szKeyword,"endselect") == 0 ) { 751         if (strcmp(szKeyword,"endselect") == 0 || strcmp(szKeyword,"endswitch") == 0 ) {
521 752         levelNext--;
522 753         levelNext--;
523 754         levelCurrent--;
85 skipped lines
609 840     "#autoit Sent keys",
610 841     "#autoit Pre-processors",
611 842     "#autoit Special",
  843     "#autoit Expand",
612 844     0
613 845 };
614 846 LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists);
1 skipped line

   Text comparison Options  

Syntax colouring language used: C / C++
Match character case: yes.
Match line endings: no.
Match spaces

At start of lines: yes,
In middle of lines: yes,
At end of lines: yes.
Blank lines as empty lines: no.
Activate comparison algorithm
At word level: yes,
At character level: no.


   Legend  

Unchanged lineExample of unchanged line
Modified lineExample of modified line
Added lineExample of added line
Removed lineExample of removed line
Ignored lineExample of ignored line

This report has been generated by Ellié Computing Merge on 2006-09-07 15:48:19.001 +0200.
© 2005-2006 Ellié Computing http://www.elliecomputing.com. All rights reserved.