MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / parseTopLevel

Function parseTopLevel

lib/filbert.js:1719–1732  ·  view source on GitHub ↗
(program)

Source from the content-addressed store, hash-verified

1717 // to its body instead of creating a new node.
1718
1719 function parseTopLevel(program) {
1720 lastStart = lastEnd = tokPos;
1721 if (options.locations) lastEndLoc = new Position;
1722 inFunction = strict = null;
1723 bracketNesting = 0;
1724 readToken();
1725 var node = program || startNode();
1726 if (!program) node.body = [];
1727 while (tokType !== _eof) {
1728 var stmt = parseStatement();
1729 if (stmt) node.body.push(stmt);
1730 }
1731 return finishNode(node, "Program");
1732 }
1733
1734 // Parse a single statement.
1735 //

Callers 1

filbert.jsFile · 0.85

Calls 4

readTokenFunction · 0.85
startNodeFunction · 0.85
parseStatementFunction · 0.85
finishNodeFunction · 0.85

Tested by

no test coverage detected