Make ReaderState.DELIMITERS accessible

This commit is contained in:
Tony Garnock-Jones 2024-05-14 17:16:06 +02:00
parent 35e6ba2e82
commit 77c16df89b
1 changed files with 4 additions and 2 deletions

View File

@ -155,13 +155,15 @@ export class ReaderState {
this.error(`Delimiter must follow ${prefix}`, this.pos);
}
static readonly DELIMITERS = '(){}[]<>";,@#:|';
delimiterFollows(): boolean {
if (this.atEnd()) return true;
const ch = this.peek();
return ('(){}[]<>";,@#:|'.indexOf(ch) !== -1) || isSpace(ch);
return (ReaderState.DELIMITERS.indexOf(ch) !== -1) || isSpace(ch);
}
readRawSymbolOrNumber<T extends Embeddable>(acc: string): number | bigint | symbol | DoubleFloat {
readRawSymbolOrNumber(acc: string): number | bigint | symbol | DoubleFloat {
while (!this.delimiterFollows()) acc = acc + this.nextchar();
const m = NUMBER_RE.exec(acc);
if (m) {