( msg: string, node: Node, ctx: ScriptCompileContext, scope?: TypeScope, )
| 151 | } |
| 152 | |
| 153 | function generateError( |
| 154 | msg: string, |
| 155 | node: Node, |
| 156 | ctx: ScriptCompileContext, |
| 157 | scope?: TypeScope, |
| 158 | ) { |
| 159 | const offset = scope ? scope.offset : ctx.startOffset! |
| 160 | return `${msg}\n\n${(scope || ctx.descriptor).filename}\n${generateCodeFrame( |
| 161 | (scope || ctx.descriptor).source, |
| 162 | node.start! + offset, |
| 163 | node.end! + offset, |
| 164 | )}` |
| 165 | } |
| 166 | |
| 167 | export function resolveParserPlugins( |
| 168 | lang: string, |
no test coverage detected