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

Function fxGetNextDigits

xs/sources/xsLexical.c:188–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188txString fxGetNextDigits(txParser* parser, txString (*f)(txParser*, txString, txString), txString p, txString q, int empty)
189{
190 int separator = 0;
191 for (;;) {
192 txString r = p;
193 p = (*f)(parser, p, q);
194 if (r < p) {
195 empty = 0;
196 separator = 0;
197 if (parser->character == '_') {
198 fxGetNextCharacter(parser);
199 separator = 1;
200 }
201 else
202 break;
203 }
204 else
205 break;
206 }
207 if (empty || separator)
208 fxReportParserError(parser, parser->states[2].line, "invalid number");
209 return p;
210}
211
212txString fxGetNextDigitsB(txParser* parser, txString p, txString q)
213{

Callers 4

fxGetNextNumberBFunction · 0.85
fxGetNextNumberEFunction · 0.85
fxGetNextNumberOFunction · 0.85
fxGetNextNumberXFunction · 0.85

Calls 2

fxGetNextCharacterFunction · 0.85
fxReportParserErrorFunction · 0.85

Tested by

no test coverage detected