| 119 | } |
| 120 | |
| 121 | xsBooleanValue fxIsKeyword(char* string, uint32_t length, xsBooleanValue* noRegExp) |
| 122 | { |
| 123 | char* keywordString; |
| 124 | uint32_t keywordLength; |
| 125 | int low, high, index, delta; |
| 126 | for (low = 0, high = XS_KEYWORD_COUNT; high > low; (delta < 0) ? (low = index + 1) : (high = index)) { |
| 127 | index = low + ((high - low) / 2); |
| 128 | keywordString = gxKeywords[index].string; |
| 129 | keywordLength = c_strlen(keywordString); |
| 130 | delta = c_strncmp(gxKeywords[index].string, (const char*)string, length); |
| 131 | if (delta == 0) { |
| 132 | if (keywordLength < length) |
| 133 | delta = 1; |
| 134 | else if (keywordLength > length) |
| 135 | delta = -1; |
| 136 | else { |
| 137 | *noRegExp = gxKeywords[index].noRegExp; |
| 138 | return 1; |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | return 0; |
| 143 | } |
| 144 | |
| 145 | void fxParseJSCode(PiuCodeParser parser, xsBooleanValue template) |
| 146 | { |