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

Function fxJSONValue

xs/sources/xsSyntaxical.c:4260–4298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4258
4259
4260void fxJSONValue(txParser* parser)
4261{
4262 switch (parser->states[0].token) {
4263 case XS_TOKEN_FALSE:
4264 fxPushNodeStruct(parser, 0, parser->states[0].token, parser->states[0].line);
4265 fxGetNextTokenJSON(parser);
4266 break;
4267 case XS_TOKEN_TRUE:
4268 fxPushNodeStruct(parser, 0, parser->states[0].token, parser->states[0].line);
4269 fxGetNextTokenJSON(parser);
4270 break;
4271 case XS_TOKEN_NULL:
4272 fxPushNodeStruct(parser, 0, parser->states[0].token, parser->states[0].line);
4273 fxGetNextTokenJSON(parser);
4274 break;
4275 case XS_TOKEN_INTEGER:
4276 fxPushIntegerNode(parser, parser->states[0].integer, parser->states[0].line);
4277 fxGetNextTokenJSON(parser);
4278 break;
4279 case XS_TOKEN_NUMBER:
4280 fxPushNumberNode(parser, parser->states[0].number, parser->states[0].line);
4281 fxGetNextTokenJSON(parser);
4282 break;
4283 case XS_TOKEN_STRING:
4284 fxPushStringNode(parser, parser->states[0].stringLength, parser->states[0].string, parser->states[0].line);
4285 fxGetNextTokenJSON(parser);
4286 break;
4287 case XS_TOKEN_LEFT_BRACE:
4288 fxJSONObject(parser);
4289 break;
4290 case XS_TOKEN_LEFT_BRACKET:
4291 fxJSONArray(parser);
4292 break;
4293 default:
4294 fxPushNULL(parser);
4295 fxReportParserError(parser, parser->states[0].line, "invalid value");
4296 break;
4297 }
4298}
4299
4300void fxJSONObject(txParser* parser)
4301{

Callers 4

fxJSONObjectFunction · 0.85
fxJSONArrayFunction · 0.85
fxJSONModuleFunction · 0.85
fxParserSourceMapFunction · 0.85

Calls 9

fxPushNodeStructFunction · 0.85
fxGetNextTokenJSONFunction · 0.85
fxPushIntegerNodeFunction · 0.85
fxPushNumberNodeFunction · 0.85
fxPushStringNodeFunction · 0.85
fxJSONObjectFunction · 0.85
fxJSONArrayFunction · 0.85
fxPushNULLFunction · 0.85
fxReportParserErrorFunction · 0.85

Tested by

no test coverage detected