MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / parseInternal

Function parseInternal

packages/core/ui/builder/index.ts:284–305  ·  view source on GitHub ↗
(value: string, context: any, xmlModule?: string, moduleName?: string)

Source from the content-addressed store, hash-verified

282}
283
284function parseInternal(value: string, context: any, xmlModule?: string, moduleName?: string): ComponentModule {
285 if (__UI_USE_XML_PARSER__) {
286 let start: xml2ui.XmlStringParser;
287 let ui: xml2ui.ComponentParser;
288
289 const errorFormat = debug && xmlModule ? xml2ui.SourceErrorFormat(xmlModule) : xml2ui.PositionErrorFormat;
290 const componentSourceTracker =
291 debug && xmlModule
292 ? xml2ui.ComponentSourceTracker(xmlModule)
293 : () => {
294 // no-op
295 };
296
297 (start = new xml2ui.XmlStringParser(errorFormat)).pipe(new xml2ui.PlatformFilter()).pipe(new xml2ui.XmlStateParser((ui = new xml2ui.ComponentParser(context, errorFormat, componentSourceTracker, moduleName))));
298
299 start.parse(value);
300
301 return ui.rootComponentModule;
302 } else {
303 return null;
304 }
305}
306
307export namespace xml2ui {
308 /**

Callers 3

parseMethod · 0.85
loadInternalFunction · 0.85

Calls 2

pipeMethod · 0.65
parseMethod · 0.65

Tested by

no test coverage detected