(value: string, context: any, xmlModule?: string, moduleName?: string)
| 282 | } |
| 283 | |
| 284 | function 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 | |
| 307 | export namespace xml2ui { |
| 308 | /** |
no test coverage detected