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

Function fxVariableStatement

xs/sources/xsSyntaxical.c:1776–1811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1774}
1775
1776void fxVariableStatement(txParser* parser, txToken theToken, txUnsigned flags)
1777{
1778 txBoolean commaFlag = 0;
1779 txInteger aCount = 0;
1780 txInteger aLine = parser->states[0].line;
1781 fxMatchToken(parser, theToken);
1782 while (gxTokenFlags[parser->states[0].token] & XS_TOKEN_BEGIN_BINDING) {
1783 commaFlag = 0;
1784 fxBinding(parser, theToken, 1 | flags);
1785// if (parser->states[0].token == XS_TOKEN_ASSIGN) {
1786// parser->flags &= ~mxForFlag;
1787// fxGetNextToken(parser);
1788// fxAssignmentExpression(parser);
1789// fxPushNodeStruct(parser, 2, XS_TOKEN_ASSIGN, aLine);
1790// fxPushNodeStruct(parser, 1, XS_TOKEN_STATEMENT, aLine);
1791// }
1792 aCount++;
1793 if (parser->states[0].token == XS_TOKEN_COMMA) {
1794 parser->flags &= ~mxForFlag;
1795 fxGetNextToken(parser);
1796 commaFlag = 1;
1797 }
1798 else
1799 break;
1800 }
1801 if ((aCount == 0) || commaFlag) {
1802 fxPushNULL(parser);
1803 fxPushNULL(parser);
1804 fxPushNodeStruct(parser, 2, theToken, aLine);
1805 fxReportParserError(parser, parser->states[0].line, "missing identifier");
1806 }
1807 if (aCount > 1) {
1808 fxPushNodeList(parser, aCount);
1809 fxPushNodeStruct(parser, 1, XS_TOKEN_STATEMENTS, aLine);
1810 }
1811}
1812
1813void fxWhileStatement(txParser* parser)
1814{

Callers 4

fxExportDeclarationFunction · 0.85
fxStatementFunction · 0.85
fxForStatementFunction · 0.85
ifFunction · 0.85

Calls 7

fxMatchTokenFunction · 0.85
fxBindingFunction · 0.85
fxGetNextTokenFunction · 0.85
fxPushNULLFunction · 0.85
fxPushNodeStructFunction · 0.85
fxReportParserErrorFunction · 0.85
fxPushNodeListFunction · 0.85

Tested by

no test coverage detected