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

Function fxJSXElementName

xs/sources/xsSyntaxical.c:4561–4590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4559}
4560
4561void fxJSXElementName(txParser* parser)
4562{
4563 txInteger line = parser->states[0].line;
4564 txSymbol* symbol = parser->states[0].symbol;
4565 fxGetNextToken(parser);
4566 if (parser->states[0].token == XS_TOKEN_COLON) {
4567 fxGetNextToken(parser);
4568 if (parser->states[0].token == XS_TOKEN_IDENTIFIER)
4569 symbol = fxJSXNamespace(parser, symbol, parser->states[0].symbol);
4570 else
4571 fxReportParserError(parser, parser->states[0].line, "missing name");
4572 fxPushSymbol(parser, symbol);
4573 fxPushNodeStruct(parser, 1, XS_TOKEN_ACCESS, line);
4574 fxGetNextToken(parser);
4575 }
4576 else {
4577 fxPushSymbol(parser, symbol);
4578 fxPushNodeStruct(parser, 1, XS_TOKEN_ACCESS, line);
4579 while (parser->states[0].token == XS_TOKEN_DOT) {
4580 fxGetNextToken(parser);
4581 if (parser->states[0].token == XS_TOKEN_IDENTIFIER) {
4582 fxPushSymbol(parser, parser->states[0].symbol);
4583 fxPushNodeStruct(parser, 2, XS_TOKEN_MEMBER, parser->states[0].line);
4584 fxGetNextToken(parser);
4585 }
4586 else
4587 fxReportParserError(parser, parser->states[0].line, "missing property");
4588 }
4589 }
4590}
4591
4592txBoolean fxJSXMatch(txParser* parser, txNode* opening, txNode* closing)
4593{

Callers 1

fxJSXElementFunction · 0.85

Calls 5

fxGetNextTokenFunction · 0.85
fxJSXNamespaceFunction · 0.85
fxReportParserErrorFunction · 0.85
fxPushSymbolFunction · 0.85
fxPushNodeStructFunction · 0.85

Tested by

no test coverage detected