| 284 | const source = ast.source!; |
| 285 | const recursiveSpanUnparser = new (class extends RecursiveAstVisitor { |
| 286 | private recordUnparsed(ast: any, spanKey: string, unparsedList: UnparsedWithSpan[]) { |
| 287 | const span = ast[spanKey]; |
| 288 | const prefix = spanKey === 'span' ? '' : `[${spanKey}] `; |
| 289 | const src = source.substring(span.start, span.end); |
| 290 | unparsedList.push([unparse(ast), prefix + src]); |
| 291 | } |
| 292 | |
| 293 | override visit(ast: AST, unparsedList: UnparsedWithSpan[]) { |
| 294 | this.recordUnparsed(ast, 'span', unparsedList); |