def _parse_file(self, app, name, source): app_name = name[:-4] parser = ZmeiParser() parser.parse_string(source) return app_name, parser
def _parse_file(self, app, name, source): extension = name[-3:] app_name = name[:-4] if extension == "col": parser = ZmeiParser() elif extension == "hcl": parser = HclParser() else: raise NotImplementedError( f"Not supported file extension: .{extension}") parser.parse_string(source) return app_name, parser
def _(code): parser = ZmeiParser() parser.parse_string(dedent(code)) return parser.populate_application('example')