(self)
| 133 | raise RuntimeError(f"{ScriptMacro.parser_object_name} not available") |
| 134 | |
| 135 | def get_macro_def(self): |
| 136 | ast_module = self.source.as_ast() |
| 137 | for decl in ast_module.body: |
| 138 | if isinstance(decl, doc.FunctionDef) and decl.name == self.func.__name__: |
| 139 | return decl |
| 140 | raise RuntimeError(f"cannot find macro definition for {self.func.__name__}") |
| 141 | |
| 142 | def __call__(self, *args, **kwargs): |
| 143 | param_binding = inspect.signature(self.func).bind(*args, **kwargs) |
no test coverage detected