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

Function fxParserTree

xs/sources/xsTree.c:197–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void fxParserTree(txParser* parser, void* theStream, txGetter theGetter, txUnsigned flags, txString* name)
198{
199 mxTryParser(parser) {
200 parser->stream = theStream;
201 parser->getter = theGetter;
202 parser->flags = flags;
203
204 parser->states[0].line = 1;
205 parser->states[0].modifier = parser->emptyString;
206 parser->states[0].string = parser->emptyString;
207 parser->states[1].line = 1;
208 parser->states[1].modifier = parser->emptyString;
209 parser->states[1].string = parser->emptyString;
210 parser->states[2].line = 1;
211 parser->states[2].modifier = parser->emptyString;
212 parser->states[2].string = parser->emptyString;
213
214 parser->root = NULL;
215
216 parser->flags &= ~(mxEvalFlag | mxFunctionFlag | mxGeneratorFlag | mxJSONModuleFlag);
217 fxGetNextCharacter(parser);
218 fxGetNextCharacter(parser);
219 if (flags & mxProgramFlag) {
220 fxSkipShebang(parser);
221 fxGetNextToken(parser);
222 fxProgram(parser);
223 if (flags & mxFunctionFlag)
224 fxCheckFunction(parser);
225 else if (flags & mxGeneratorFlag)
226 fxCheckGenerator(parser);
227 }
228 else if (flags & mxJSONModuleFlag) {
229 fxGetNextTokenJSON(parser);
230 fxGetNextTokenJSON(parser);
231 fxJSONModule(parser);
232 }
233 else {
234 parser->flags |= mxStrictFlag | mxAsyncFlag;
235 fxSkipShebang(parser);
236 fxGetNextToken(parser);
237 fxModule(parser);
238 }
239 parser->flags &= ~mxEvalFlag;
240
241 parser->flags |= flags & mxEvalFlag;
242
243 #ifdef mxTreePrint
244 fxTreePrint(parser, parser->root);
245 #endif
246 if ((parser->errorCount == 0) && name)
247 *name = parser->name;
248 }
249 mxCatchParser(parser) {
250 }
251}
252
253void fxNodeListDistribute(txNodeList* list, txNodeCall call, void* param)
254{

Callers 11

_xsbug_module_Function · 0.85
_xsbug_script_Function · 0.85
PiuDebugBehavior_compileFunction · 0.85
mainFunction · 0.85
fxLoadScriptFunction · 0.85
fxParseScriptFunction · 0.85
fxIncludeTreeFunction · 0.85
fxParseScriptFunction · 0.85
fxParseScriptFunction · 0.85
fxParseScriptFunction · 0.85

Calls 10

fxGetNextCharacterFunction · 0.85
fxSkipShebangFunction · 0.85
fxGetNextTokenFunction · 0.85
fxProgramFunction · 0.85
fxCheckFunctionFunction · 0.85
fxCheckGeneratorFunction · 0.85
fxGetNextTokenJSONFunction · 0.85
fxJSONModuleFunction · 0.85
fxModuleFunction · 0.85
fxTreePrintFunction · 0.85

Tested by

no test coverage detected