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

Function fxTemplateExpression

xs/sources/xsSyntaxical.c:3217–3245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3215}
3216
3217void fxTemplateExpression(txParser* parser)
3218{
3219 txInteger aCount = 0;
3220 txInteger aLine = parser->states[0].line;
3221 fxPushStringNode(parser, parser->states[0].stringLength, parser->states[0].string, aLine);
3222 fxPushRawNode(parser, parser->states[0].rawLength, parser->states[0].raw, aLine);
3223 fxPushNodeStruct(parser, 2, XS_TOKEN_TEMPLATE_MIDDLE, aLine);
3224 aCount++;
3225 for (;;) {
3226 fxGetNextToken(parser);
3227 if (parser->states[0].token != XS_TOKEN_RIGHT_BRACE) {
3228 fxCommaExpression(parser);
3229 aCount++;
3230 }
3231 if (parser->states[0].token != XS_TOKEN_RIGHT_BRACE) {
3232 fxReportParserError(parser, parser->states[0].line, "missing }");
3233 }
3234 fxGetNextTokenTemplate(parser);
3235 fxPushStringNode(parser, parser->states[0].stringLength, parser->states[0].string, aLine);
3236 fxPushRawNode(parser, parser->states[0].rawLength, parser->states[0].raw, aLine);
3237 fxPushNodeStruct(parser, 2, XS_TOKEN_TEMPLATE_MIDDLE, aLine);
3238 aCount++;
3239 if (parser->states[0].token == XS_TOKEN_TEMPLATE_TAIL) {
3240 fxGetNextToken(parser);
3241 break;
3242 }
3243 }
3244 fxPushNodeList(parser, aCount);
3245}
3246
3247void fxYieldExpression(txParser* parser)
3248{

Callers 3

fxCallExpressionFunction · 0.85
fxLiteralExpressionFunction · 0.85
fxNewExpressionFunction · 0.85

Calls 8

fxPushStringNodeFunction · 0.85
fxPushRawNodeFunction · 0.85
fxPushNodeStructFunction · 0.85
fxGetNextTokenFunction · 0.85
fxCommaExpressionFunction · 0.85
fxReportParserErrorFunction · 0.85
fxGetNextTokenTemplateFunction · 0.85
fxPushNodeListFunction · 0.85

Tested by

no test coverage detected