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

Function fxJSXAttributeValue

xs/sources/xsSyntaxical.c:4420–4447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4418}
4419
4420void fxJSXAttributeValue(txParser* parser)
4421{
4422 txInteger line = parser->states[0].line;
4423 fxGetNextTokenJSXAttribute(parser);
4424 if (parser->states[0].token == XS_TOKEN_STRING) {
4425 fxPushStringNode(parser, parser->states[0].stringLength, parser->states[0].string, line);
4426 fxGetNextToken(parser);
4427 }
4428 else if (parser->states[0].token == XS_TOKEN_LEFT_BRACE) {
4429 fxGetNextToken(parser);
4430 if (parser->states[0].token == XS_TOKEN_RIGHT_BRACE) {
4431 fxGetNextToken(parser);
4432 fxReportParserError(parser, parser->states[0].line, "missing expression");
4433 fxPushNodeStruct(parser, 0, XS_TOKEN_UNDEFINED, line);
4434 }
4435 else {
4436 fxAssignmentExpression(parser);
4437 if (parser->states[0].token == XS_TOKEN_RIGHT_BRACE)
4438 fxGetNextToken(parser);
4439 else
4440 fxReportParserError(parser, parser->states[0].line, "missing }");
4441 }
4442 }
4443 else {
4444 fxReportParserError(parser, parser->states[0].line, "invalid %s", gxTokenNames[parser->states[0].token]);
4445 fxPushNodeStruct(parser, 0, XS_TOKEN_UNDEFINED, line);
4446 }
4447}
4448
4449void fxJSXElement(txParser* parser)
4450{

Callers 1

fxJSXElementFunction · 0.85

Calls 6

fxPushStringNodeFunction · 0.85
fxGetNextTokenFunction · 0.85
fxReportParserErrorFunction · 0.85
fxPushNodeStructFunction · 0.85
fxAssignmentExpressionFunction · 0.85

Tested by

no test coverage detected