* Adds a synthetic comment to the expression that represents the parse span of the provided node. * This comment can later be retrieved as trivia of a node to recover original source locations. * @param span Span from the parser containing the location information.
(span: AbsoluteSourceSpan | ParseSourceSpan)
| 56 | * @param span Span from the parser containing the location information. |
| 57 | */ |
| 58 | addParseSpanInfo(span: AbsoluteSourceSpan | ParseSourceSpan): this { |
| 59 | let start: number; |
| 60 | let end: number; |
| 61 | |
| 62 | if (span instanceof AbsoluteSourceSpan) { |
| 63 | start = span.start; |
| 64 | end = span.end; |
| 65 | } else { |
| 66 | start = span.start.offset; |
| 67 | end = span.end.offset; |
| 68 | } |
| 69 | |
| 70 | this.spanComment = `${start},${end}`; |
| 71 | return this; |
| 72 | } |
| 73 | |
| 74 | /** Marks the expression to be ignored for diagnostics. */ |
| 75 | markIgnoreDiagnostics(): this { |
no outgoing calls
no test coverage detected