Tokenizing fallibility (#883)
Tokenization tracks invalid tokens and produces a nice error about them --------- Co-authored-by: Adam Chalmers <adam.chalmers@kittycad.io>
This commit is contained in:
committed by
GitHub
parent
3d0c5c10b0
commit
2e419907e6
@ -18,6 +18,13 @@ export class KCLError {
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLLexicalError extends KCLError {
|
||||
constructor(msg: string, sourceRanges: [number, number][]) {
|
||||
super('lexical', msg, sourceRanges)
|
||||
Object.setPrototypeOf(this, KCLSyntaxError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLSyntaxError extends KCLError {
|
||||
constructor(msg: string, sourceRanges: [number, number][]) {
|
||||
super('syntax', msg, sourceRanges)
|
||||
|
Reference in New Issue
Block a user