MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxCheckStrictKeyword

Function fxCheckStrictKeyword

xs/sources/xsLexical.c:120–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120void fxCheckStrictKeyword(txParser* parser)
121{
122 int low, high, anIndex, aDelta;
123 for (low = 0, high = XS_STRICT_KEYWORD_COUNT; high > low;
124 (aDelta < 0) ? (low = anIndex + 1) : (high = anIndex)) {
125 anIndex = low + ((high - low) / 2);
126 aDelta = c_strcmp(gxStrictKeywords[anIndex].text, parser->buffer);
127 if (aDelta == 0) {
128 parser->states[0].token = gxStrictKeywords[anIndex].token;
129 goto bail;
130 }
131 }
132bail:
133 if (parser->states[0].escaped)
134 fxReportParserError(parser, parser->states[0].line, "escaped keyword");
135}
136
137void fxGetNextCharacter(txParser* parser)
138{

Callers 2

fxProgramFunction · 0.85
fxBodyFunction · 0.85

Calls 1

fxReportParserErrorFunction · 0.85

Tested by

no test coverage detected