|
|
@@ -174,8 +174,15 @@ static int syntax_select (char * string, int * length) { |
|
|
|
// it's best to modify only variable 'length', hence we check with 'string_compare_limit' function. |
|
|
|
for (select = offset = 0; select != syntax_count; ++select) { // We're looping defined syntax rules: |
|
|
|
if (syntax_enrange [select] == FALSE) { // Choosing the comparisson: |
|
|
|
if (string_compare_limit (string, syntax_begin [select], string_length (syntax_begin [select])) == TRUE) { // Limiting our string comparisson. |
|
|
|
break; // If strings are same, we exit the loop. |
|
|
|
if (syntax_derange [select] == FALSE) { |
|
|
|
if (string_compare_limit (string, syntax_begin [select], string_length (syntax_begin [select])) == TRUE) { // Limiting our string comparisson. |
|
|
|
break; // If strings are same, we exit the loop. |
|
|
|
} |
|
|
|
} else { |
|
|
|
if ((string_compare_limit (string, syntax_begin [select], string_length (syntax_begin [select])) == TRUE) |
|
|
|
&& (character_compare_array (string [offset + string_length (syntax_begin [select])], syntax_end [select]) == TRUE)) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { // Else, we compare any character. |
|
|
|
if (character_compare_array (string [offset], syntax_begin [select]) == TRUE) { // With our obviously named function... |
|
|
@@ -209,7 +216,8 @@ static int syntax_select (char * string, int * length) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (string_compare (syntax_end [select], "") == TRUE) { // And here's our empty string exception. |
|
|
|
if (syntax_end [select] [0] == CHARACTER_NULL) { // And here's our empty string exception. |
|
|
|
* length = offset; |
|
|
|
break; |
|
|
|
} |
|
|
|
if (character_compare_array (string [offset], syntax_end [select]) == TRUE) { |
|
|
|