- bool isMultiline = 0;
- char* cur = str;
- char* end = str + strLen;
-
- int cur_rank = ( isComment == 1 ) ? RANK_GREEN : RANK_BLACK;
- int cur_range_len = 0;
-
- while ( cur != end )
- {
- int has_next = ( cur+1 != end );
-
- if ( isComment )
- {
- if ( *cur == '*' )
- if ( has_next && *(cur+1) == '/' )
- {
- // turn off multiline comment mode
- cur += 2;
- cur_range_len += 2;
- isComment = 0;
- isMultiline = 0;
- STORE_RANGE;
-
- continue;
- }
-
- ++cur_range_len;
- ++cur;
- continue;
- }
-
- /*
- if ( *cur == 10 )
- if ( isComment )
- if ( isMultiline )
- {
- cur_rank = RANK_GREEN;
- cur_range_len = end - cur;
- STORE_RANGE;
- isComment = 0;
- isMultiline = 0;
- continue;
- }*/
-
- if ( *cur == '/' )
- {
- if ( has_next )
- {
- if ( *(cur+1) == '/' )
- {
- STORE_RANGE;
-
- char* eol = cur;
- while ( eol < end && *eol != 10 )
- ++eol;
-
- cur_rank = RANK_GREEN;
- cur_range_len = eol - cur;
- cur = eol;
- STORE_RANGE;
-
- continue;
- }
-
- if ( *(cur+1) == '*' )
- {
- STORE_RANGE;
- cur_rank = RANK_GREEN;
- cur_range_len = 2;
- isComment = 1;
- cur += 2;
- isMultiline = 1;
- continue;
- }
- }
-
- NEXT_CHAR;
- }
-
- if ( ( is_alpha( *cur ) || *(cur) == '#' )
- && has_next
- )
- {
- if ( is_alpha( *(cur+1) ) )
- {
- char* start = cur;
- cur += 2;
-
- while ( cur != end && is_alpha(*cur) ) ++cur;
-
- int wordRank;
-
- if ( (wordRank = get_rank( start, cur )) > 0 )
- {
- STORE_RANGE;
-
- store_range( results, wordRank, int(cur-start) );
- cur_rank = cur_range_len = 0;
- continue;
- }
-
- cur_range_len += ( cur-start );
- continue;
- }
- else
- NEXT_CHAR;
- }
-
- NEXT_CHAR;
- }
-
- if ( cur_range_len > 0 ) STORE_RANGE;
+ bool isMultiline = false;
+ char* cur = str;
+ char* end = str + strLen;
+
+ int cur_rank = ( isComment == 1 ) ? RANK_GREEN : RANK_BLACK;
+ int cur_range_len = 0;
+
+ while ( cur != end )
+ {
+ int has_next = ( cur+1 != end );
+
+ if ( isComment )
+ {
+ if ( *cur == '*' )
+ if ( has_next && *(cur+1) == '/' )
+ {
+ // turn off multiline comment mode
+ cur += 2;
+ cur_range_len += 2;
+ isComment = 0;
+ isMultiline = 0;
+ STORE_RANGE;
+
+ continue;
+ }
+
+ ++cur_range_len;
+ ++cur;
+ continue;
+ }
+
+ /*
+ if ( *cur == 10 )
+ if ( isComment )
+ if ( isMultiline )
+ {
+ cur_rank = RANK_GREEN;
+ cur_range_len = end - cur;
+ STORE_RANGE;
+ isComment = 0;
+ isMultiline = 0;
+ continue;
+ }*/
+
+ if ( *cur == '/' )
+ {
+ if ( has_next )
+ {
+ if ( *(cur+1) == '/' )
+ {
+ STORE_RANGE;
+
+ char* eol = cur;
+ while ( eol < end && *eol != 10 )
+ ++eol;
+
+ cur_rank = RANK_GREEN;
+ cur_range_len = eol - cur;
+ cur = eol;
+ STORE_RANGE;
+
+ continue;
+ }
+
+ if ( *(cur+1) == '*' )
+ {
+ STORE_RANGE;
+ cur_rank = RANK_GREEN;
+ cur_range_len = 2;
+ isComment = 1;
+ cur += 2;
+ isMultiline = 1;
+ continue;
+ }
+ }
+
+ NEXT_CHAR;
+ }
+
+ if ( ( is_alpha( *cur ) || *(cur) == '#' )
+ && has_next
+ )
+ {
+ if ( is_alpha( *(cur+1) ) )
+ {
+ char* start = cur;
+ cur += 2;
+
+ while ( cur != end && is_alpha(*cur) ) ++cur;
+
+ int wordRank;
+
+ if ( (wordRank = get_rank( start, cur )) > 0 )
+ {
+ STORE_RANGE;
+
+ store_range( results, wordRank, int(cur-start) );
+ cur_rank = cur_range_len = 0;
+ continue;
+ }
+
+ cur_range_len += ( cur-start );
+ continue;
+ }
+ else
+ NEXT_CHAR;
+ }
+
+ NEXT_CHAR;
+ }
+
+ if ( cur_range_len > 0 ) STORE_RANGE;
+
+ wxUnusedVar(isMultiline);