feat: appropriate error for malformed filters, fixes #271

This commit is contained in:
Harttle
2022-03-05 23:24:16 +08:00
parent 27e579e0e2
commit 01014edc49
2 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -89,7 +89,8 @@ export class Tokenizer {
++this.p
const arg = this.readFilterArg()
arg && args.push(arg)
while (this.p < this.N && this.peek() !== ',' && this.peek() !== '|') ++this.p
this.skipBlank()
assert(this.end() || this.peek() === ',' || this.peek() === '|', () => `unexpected character ${this.snapshot()}`)
} while (this.peek() === ',')
}
return new FilterToken(name.getText(), args, this.input, begin, this.p, this.file)