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

Function fxPropertyName

xs/sources/xsSyntaxical.c:3297–3470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3295}
3296
3297void fxPropertyName(txParser* parser, txSymbol** theSymbol, txToken* theToken0, txToken* theToken1, txToken* theToken2, txUnsigned* flag)
3298{
3299 txSymbol* aSymbol = C_NULL;
3300 txToken aToken0 = XS_NO_TOKEN;
3301 txToken aToken1 = XS_NO_TOKEN;
3302 txToken aToken2 = XS_NO_TOKEN;
3303 txInteger aLine = parser->states[0].line;
3304 txIndex index;
3305 *flag = 0;
3306 fxLookAheadOnce(parser);
3307 aToken0 = parser->states[0].token;
3308 if ((gxTokenFlags[aToken0] & XS_TOKEN_IDENTIFIER_NAME)) {
3309 aSymbol = parser->states[0].symbol;
3310 if (parser->states[1].token == XS_TOKEN_COLON) {
3311 fxPushSymbol(parser, aSymbol);
3312 aToken1 = XS_TOKEN_PROPERTY;
3313 }
3314 else if (fxIsKeyword(parser, parser->asyncSymbol) && (!parser->states[1].crlf)) {
3315 *flag = mxAsyncFlag;
3316 fxGetNextToken(parser);
3317 if (parser->states[0].token == XS_TOKEN_MULTIPLY) {
3318 aToken2 = XS_TOKEN_GENERATOR;
3319 fxGetNextToken(parser);
3320 }
3321 else
3322 aToken2 = XS_TOKEN_FUNCTION;
3323 }
3324 else if (fxIsKeyword(parser, parser->getSymbol)) {
3325 aToken2 = XS_TOKEN_GETTER;
3326 fxGetNextToken(parser);
3327 }
3328 else if (fxIsKeyword(parser, parser->setSymbol)) {
3329 aToken2 = XS_TOKEN_SETTER;
3330 fxGetNextToken(parser);
3331 }
3332 else {
3333 fxPushSymbol(parser, aSymbol);
3334 aToken1 = XS_TOKEN_PROPERTY;
3335 }
3336 }
3337 else if (parser->states[0].token == XS_TOKEN_MULTIPLY) {
3338 aToken2 = XS_TOKEN_GENERATOR;
3339 fxGetNextToken(parser);
3340 }
3341 else if (parser->states[0].token == XS_TOKEN_PRIVATE_IDENTIFIER) {
3342 aSymbol = parser->states[0].symbol;
3343 fxPushSymbol(parser, aSymbol);
3344 aToken1 = XS_TOKEN_PRIVATE_PROPERTY;
3345 }
3346 else if (parser->states[0].token == XS_TOKEN_INTEGER) {
3347 if (fxIntegerToIndex(parser->console, parser->states[0].integer, &index)) {
3348 fxPushIndexNode(parser, index, aLine);
3349 aToken1 = XS_TOKEN_PROPERTY_AT;
3350 }
3351 else {
3352 aSymbol = fxNewParserSymbol(parser, fxIntegerToString(parser->console, parser->states[0].integer, parser->buffer, parser->bufferSize));
3353 fxPushSymbol(parser, aSymbol);
3354 aToken1 = XS_TOKEN_PROPERTY;

Callers 2

fxClassExpressionFunction · 0.85
fxObjectExpressionFunction · 0.85

Calls 14

fxLookAheadOnceFunction · 0.85
fxPushSymbolFunction · 0.85
fxGetNextTokenFunction · 0.85
fxIntegerToIndexFunction · 0.85
fxPushIndexNodeFunction · 0.85
fxNewParserSymbolFunction · 0.85
fxIntegerToStringFunction · 0.85
fxNumberToIndexFunction · 0.85
fxNumberToStringFunction · 0.85
fxStringToIndexFunction · 0.85
fxCommaExpressionFunction · 0.85
fxReportParserErrorFunction · 0.85

Tested by

no test coverage detected