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
25U25U//                  Added fold.compact support set with fold.compact=1
26U26U//                  Changed folding inside of #cs-#ce. Default is no keyword folding inside comment blocks when fold.comment=1
27U27U//                        it will now only happen when fold.comment=2.
28C//  28C// Sep 5, 2004    - Added logic to handle colourizing words on the last line. 
  29C//                        Typed Characters now show as "default" till they match any table.
  30C// Oct 10, 2004   - Added logic to show Comments in "Special" directives
  31C// Nov  1, 2004   - Added better testing for Numbers supporting x and e notation.
  32C// Nov 28, 2004   - Added logic to handle continuation lines for syntax highlighting.
  33C// Jan 10, 2005   - Added Abbreviations Keyword used for expansion
  34C// Mar 24, 2005   - Updated Abbreviations Keywords to fix when followed by Operator.
  35C// Apr 18, 2005   - Updated #CE/#Comment-End logic to take a linecomment ";" into account
  36C//                - Added folding support for With...EndWith
  37C//                - Added support for a DOT in variable names
  38C//                - Fixed Underscore in CommentBlock
  39C// May 23, 2005   - Fixed the SentKey lexing in case of a missing }
  40C// Aug 11, 2005   - Fixed possible bug with s_save length > 100.
  41C// Aug 23, 2005   - Added Switch/endswitch support to the folding logic.
  42C//
29U43U// Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org>
30U44U// The License.txt file describes the conditions under which this software may be distributed.
31U45U// Scintilla source code edit control
24 skipped lines
56U70U 
57U71Ustatic inline bool IsAWordStart(const int ch)
58U72U{
59C    return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$'); 73C    return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$' || ch == '.');
60U74U}
61U75U 
62U76Ustatic inline bool IsAOperator(char ch) {
25 skipped lines
88U102U    // split the portion of the sendkey in the part before and after the spaces
89U103U    while ( ( (cTemp = szLine[nPos]) != '\0'))
90U104U    {
  105C        // skip leading Ctrl/Shift/ALt state
  106C        if ((cTemp == '#' || cTemp == '!' || cTemp == '^') && (szLine[nPos+1] == '{') ) 
  107C        {
  108C        } 
91C        if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space 109C        else if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space
92U110U        {
93U111U        nFlag = 1;
94U112U        // Add } to the end of the first bit for table lookup later.
37 skipped lines
132U150U 
133U151U} // GetSendKey() 
134U152U 
  153A//
  154A// Routine to check the last "none comment" character on a line to see if its a continuation
  155A// 
  156Astatic bool IsContinuationLine(unsigned int szLine, Accessor &styler)
  157A{
18 skipped lines
  176A    return false;
  177A} // IsContinuationLine()
  178A 
  179A//
  180A// syntax highlighting logic
135U181Ustatic void ColouriseAU3Doc(unsigned int startPos, 
136U182U        int length, int initStyle,
137U183U        WordList *keywordlists[],
5 skipped lines
143U189U    WordList &keywords4 = *keywordlists[3];
144U190U    WordList &keywords5 = *keywordlists[4];
145U191U    WordList &keywords6 = *keywordlists[5];
  192A    WordList &keywords7 = *keywordlists[6];
  193A    // find the first previous line without continuation character at the end
  194A    int lineCurrent = styler.GetLine(startPos);
  195A    int s_startPos = startPos;
  196A    // When not inside a Block comment: find First line without _
5 skipped lines
  202A        initStyle =  0;                           // reset the start style to 0 
  203A        }
  204A    }
  205A    // Set the new length to include it from the start and set the start position
  206A    length = length + s_startPos - startPos;      // correct the total length to process
146U207U    styler.StartAt(startPos);
147C  208C     
148U209U    StyleContext sc(startPos, length, initStyle, styler);
149U210U    char si;     // string indicator "=1 '=2
  211C    char ni;     // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 Enot=3
  212C    char ci;     // comment indicator 0=not linecomment(;) 
  213C    char s_save[100];
150C    si=0; 214C    si=0;  
  215C    ni=0;
  216C    ci=0;
151U217U    //$$$
152U218U    for (; sc.More(); sc.Forward()) {
153U219U        char s[100];
154U220U        sc.GetCurrentLowered(s, sizeof(s));
  221A        // **********************************************
  222A        // save the total current word for eof processing 
  223A        if (IsAWordChar(sc.ch) || sc.ch == '}') 
  224A        {
  225A        strcpy(s_save,s);
3 skipped lines
  229A        s_save[tp+1] = '\0';
  230A        }
  231A        }
  232A        // **********************************************
  233A        //
155U234U        switch (sc.state)
156U235U        {
157U236U            case SCE_AU3_COMMENTBLOCK:
158U237U            {
  238C        //Reset at line end
  239C        if (sc.atLineEnd) {
  240C        ci=0;
  241C        sc.SetState(SCE_AU3_COMMENTBLOCK);
  242C        }
  243C        //skip rest of line when a ; is encountered
  244C        if (sc.chPrev == ';') {
  245C        ci=2;
  246C        sc.SetState(SCE_AU3_COMMENTBLOCK);
  247C        }
  248C        // skip rest of the line
  249C        if (ci==2) 
  250C        break;
  251C        // check when first character is detected on the lin
  252C        if (ci==0) {
  253C        if (IsAWordStart(static_cast<char>(sc.ch)) || IsAOperator(static_cast<char>(sc.ch))) {
  254C        ci=1;
  255C        sc.SetState(SCE_AU3_COMMENTBLOCK);
  256C        }
  257C        break;
  258C        }
159C        if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) 259C        if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) {
160C        {  
161U260U        if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0)) 
162C        {sc.SetState(SCE_AU3_COMMENT);}  // set to comment line for the rest of the line 261C        sc.SetState(SCE_AU3_COMMENT);  // set to comment line for the rest of the line
163U262U        else
164C        {sc.SetState(SCE_AU3_COMMENTBLOCK);} 263C        ci=2;  // line doesn't begin with #CE so skip the rest of the line
165U264U        }
166U265U                break;
167U266U        }
4 skipped lines
172U271U            }
173U272U            case SCE_AU3_OPERATOR:
174U273U            {
  274C                // check if its a COMobject 
  275C        if (sc.chPrev == '.' && IsAWordChar(sc.ch)) {
  276C        sc.SetState(SCE_AU3_COMOBJ);
  277C        } 
  278C        else {
175C                sc.SetState(SCE_AU3_DEFAULT); 279C        sc.SetState(SCE_AU3_DEFAULT);
  280C        }
176U281U                break;
177U282U            }
178U283U            case SCE_AU3_SPECIAL:
179U284U            {
  285C                if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);}
180C                if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} 286C        if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);}
181U287U                break;
182U288U            }
183U289U            case SCE_AU3_KEYWORD:
31 skipped lines
215U321U        sc.ChangeState(SCE_AU3_SPECIAL);
216U322U        sc.SetState(SCE_AU3_SPECIAL);
217U323U        }
  324A        else if ((keywords7.InList(s)) && (!IsAOperator(static_cast<char>(sc.ch)))) {
  325A        sc.ChangeState(SCE_AU3_EXPAND);
  326A        sc.SetState(SCE_AU3_DEFAULT);
  327A        }
218U328U        else if (strcmp(s, "_") == 0) {
219U329U        sc.ChangeState(SCE_AU3_OPERATOR);
220U330U        sc.SetState(SCE_AU3_DEFAULT);
4 skipped lines
225U335U        }
226U336U        }
227U337U        } 
  338C                if (sc.atLineEnd) {
228C                if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} 339C        sc.SetState(SCE_AU3_DEFAULT);}
229U340U                break;
230U341U            }
231C            case SCE_AU3_NUMBER: 342C        case SCE_AU3_NUMBER:
232U343U            {
  344C        // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 E-not=3
  345C        //
  346C        // test for Hex notation
  347C        if (strcmp(s, "0") == 0 && (sc.ch == 'x' || sc.ch == 'X') && ni == 0)
  348C        {
  349C        ni = 2;
  350C        break;
  351C        }
  352C        // test for E notation
  353C        if (IsADigit(sc.chPrev) && (sc.ch == 'e' || sc.ch == 'E') && ni <= 1)
32 skipped lines
  386C        }
  387C        break;
  388C        }
  389C        case SCE_AU3_VARIABLE:
  390C        {
  391C        // Check if its a COMObject
  392C        if (sc.ch == '.' && !IsADigit(sc.chNext)) {
  393C        sc.SetState(SCE_AU3_OPERATOR);
  394C        }
  395C        else if (!IsAWordChar(sc.ch)) {
233C                if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_AU3_DEFAULT);} 396C        sc.SetState(SCE_AU3_DEFAULT);
  397C        }
234C                break; 398C        break;
235U399U            }
236C            case SCE_AU3_VARIABLE: 400C        case SCE_AU3_COMOBJ:
237C            { 401C        {
  402C        if (!(IsAWordChar(sc.ch))) {
238C                if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_AU3_DEFAULT);} 403C        sc.SetState(SCE_AU3_DEFAULT);
  404C        }
239C                break; 405C        break;
240U406U            }
241U407U            case SCE_AU3_STRING:
242U408U            {
3 skipped lines
246U412U        {
247U413U        sc.ForwardSetState(SCE_AU3_DEFAULT);
248U414U        }
  415C                if (sc.atLineEnd)
  416C        {
  417C        // at line end and not found a continuation char then reset to default
  418C        int lineCurrent = styler.GetLine(sc.currentPos);
  419C        if (!IsContinuationLine(lineCurrent,styler)) 
  420C        {
249C                if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} 421C        sc.SetState(SCE_AU3_DEFAULT);
  422C        }
  423C        }
250U424U        // find Sendkeys in a STRING
251U425U        if (sc.ch == '{') {sc.SetState(SCE_AU3_SENT);}
252U426U        if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
35 skipped lines
288U462U        // check if next portion is again a sendkey
289U463U        if (sc.atLineEnd
290U464U        {
  465A        sc.ChangeState(SCE_AU3_STRING);
291U466U        sc.SetState(SCE_AU3_DEFAULT);
292U467U        si = 0;  // reset string indicator
293U468U        }
294C        if (sc.ch == '{' && sc.chPrev != '{') {sc.SetState(SCE_AU3_SENT);} 469C        //if (sc.ch == '{' && sc.chPrev != '{') {sc.SetState(SCE_AU3_SENT);}
295U470U        if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
296U471U        if (sc.ch == '!' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
297U472U        if (sc.ch == '^' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
16 skipped lines
314U489U            if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);}
315U490U            else if (sc.ch == '#') {sc.SetState(SCE_AU3_KEYWORD);}
316U491U            else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);}
  492A            else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);}
317U493U            else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);}
318U494U            else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);}  // string after #include 
319U495U            else if (sc.ch == '\"') {
2 skipped lines
322U498U            else if (sc.ch == '\'') {
323U499U        sc.SetState(SCE_AU3_STRING);
324U500U        si = 2;   }
325C            else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {sc.SetState(SCE_AU3_NUMBER);} 501C            else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) 
  502C        {
  503C        sc.SetState(SCE_AU3_NUMBER);
  504C        ni = 0;
  505C        }
326U506U            else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_AU3_KEYWORD);}
327U507U            else if (IsAOperator(static_cast<char>(sc.ch))) {sc.SetState(SCE_AU3_OPERATOR);}
328U508U        else if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);}
329U509U        }
330U510U    }      //for (; sc.More(); sc.Forward())
  511C 
  512C    //*************************************
  513C    // Colourize the last word correctly 
  514C    //*************************************
  515C    if (sc.state == SCE_AU3_KEYWORD)
  516C        {
  517C        if (strcmp(s_save, "#cs")== 0 || strcmp(s_save, "#comments-start")== 0 )
  518C        {
  519C        sc.ChangeState(SCE_AU3_COMMENTBLOCK);
  520C        sc.SetState(SCE_AU3_COMMENTBLOCK);
57 skipped lines
  578C        sc.SetState(SCE_AU3_STRING);
  579C        }
  580C        // check if next portion is again a sendkey
  581C        if (sc.atLineEnd
  582C        {
  583C        sc.ChangeState(SCE_AU3_STRING);
  584C        sc.SetState(SCE_AU3_DEFAULT);
  585C        }
  586C    }
  587C    //*************************************
331C    sc.Complete(); 588C    sc.Complete();
332U589U}
333U590U 
334U591U//
17 skipped lines
352U609U 
353U610U} // GetStyleFirstWord()
354U611U 
355R//  
356R// Routine to check the last "none comment" character on a line to see if its a continuation  
357R//   
358Rstatic bool IsContinuationLine(unsigned int szLine, Accessor &styler)  
359R{  
16 skipped lines
376R        nePos--; // skip to next char  
377R    } // End While  
378R    return false;  
379R} // IsContinuationLine()  
380R   
381U612U 
382U613U//
383U614Ustatic void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
112 skipped lines
496U727U        // create new fold for these words 
497U728U        if (strcmp(szKeyword,"do") == 0   || strcmp(szKeyword,"for") == 0 ||
498U729U        strcmp(szKeyword,"func") == 0 || strcmp(szKeyword,"while") == 0||
499C        strcmp(szKeyword,"#region") == 0 ) { 730C        strcmp(szKeyword,"with") == 0 || strcmp(szKeyword,"#region") == 0 ) {
500U731U        levelNext++;
501U732U        }
502C        // create double Fold for select because Case will subtract one of the current level 733C        // create double Fold for select&switch because Case will subtract one of the current level
503C        if (strcmp(szKeyword,"select") == 0) { 734C        if (strcmp(szKeyword,"select") == 0 || strcmp(szKeyword,"switch") == 0) {
504U735U        levelNext++;
505U736U        levelNext++;
506U737U        }
507U738U        // end the fold for these words before the current line
508U739U        if (strcmp(szKeyword,"endfunc") == 0 || strcmp(szKeyword,"endif") == 0 ||
509U740U        strcmp(szKeyword,"next") == 0    || strcmp(szKeyword,"until") == 0 || 
510C        strcmp(szKeyword,"wend") == 0){ 741C        strcmp(szKeyword,"endwith") == 0 ||strcmp(szKeyword,"wend") == 0){
511U742U        levelNext--;
512U743U        levelCurrent--;
513U744U        }
3 skipped lines
517U748U        levelCurrent--;
518U749U        }
519U750U        // end the double fold for this word before the current line
520C        if (strcmp(szKeyword,"endselect") == 0 ) { 751C        if (strcmp(szKeyword,"endselect") == 0 || strcmp(szKeyword,"endswitch") == 0 ) {
521U752U        levelNext--;
522U753U        levelNext--;
523U754U        levelCurrent--;
85 skipped lines
609U840U    "#autoit Sent keys",
610U841U    "#autoit Pre-processors",
611U842U    "#autoit Special",
  843A    "#autoit Expand",
612U844U    0
613U845U};
614U846ULexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists);
1 skipped line

   Text comparison Options  

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  

UExample of unchanged line
CExample of modified line
AExample of added line
RExample of removed line
IExample of ignored line
Modified text
Added text
Removed text

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