MCPcopy
hub / github.com/baidu/amis / expressionList

Function expressionList

packages/amis-formula/src/parser.ts:595–627  ·  view source on GitHub ↗
(startOP = '(', endOp = ')')

Source from the content-addressed store, hash-verified

593 }
594
595 function expressionList(startOP = '(', endOp = ')'): ASTNodeOrNull {
596 if (matchPunctuator(startOP)) {
597 const start = token;
598 let end: Token;
599 next();
600 const args: Array<any> = [];
601 let state = argListStates.START;
602
603 while (true) {
604 if (state === argListStates.COMMA || !matchPunctuator(endOp)) {
605 const arg = assert(expression());
606 args.push(arg);
607 state = argListStates.START;
608
609 if (matchPunctuator(',')) {
610 next();
611 state = argListStates.COMMA;
612 }
613 } else if (matchPunctuator(endOp)) {
614 end = token;
615 next();
616 break;
617 }
618 }
619 return {
620 type: 'expression-list',
621 body: args,
622 start: start.start,
623 end: end!.end
624 };
625 }
626 return null;
627 }
628
629 function argList(startOP = '(', endOp = ')'): ASTNodeOrNull {
630 let count = 0;

Callers 3

primaryExpressionFunction · 0.85
functionCallFunction · 0.85
arrayLiteralFunction · 0.85

Calls 5

matchPunctuatorFunction · 0.85
nextFunction · 0.85
assertFunction · 0.85
expressionFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected