fix: rename createLexerFormCharStream to createLexerFromCharStream (#243)

This commit is contained in:
霜序
2024-01-04 11:45:41 +08:00
committed by hayden
parent 1c288b737a
commit 4d19f05890
9 changed files with 11 additions and 11 deletions

View File

@ -60,7 +60,7 @@ export default abstract class BasicParser<
* Create a antlr4 Lexer instance.
* @param input source string
*/
protected abstract createLexerFormCharStream(charStreams: CodePointCharStream): L;
protected abstract createLexerFromCharStream(charStreams: CodePointCharStream): L;
/**
* Create Parser by CommonTokenStream
@ -93,7 +93,7 @@ export default abstract class BasicParser<
*/
public createLexer(input: string, errorListener?: ErrorListener<any>) {
const charStreams = CharStreams.fromString(input.toUpperCase());
const lexer = this.createLexerFormCharStream(charStreams);
const lexer = this.createLexerFromCharStream(charStreams);
if (errorListener) {
lexer.removeErrorListeners();
lexer.addErrorListener(new ParseErrorListener(errorListener));
@ -140,7 +140,7 @@ export default abstract class BasicParser<
private createParserWithCache(input: string): P {
this._parseTree = null;
this._charStreams = CharStreams.fromString(input.toUpperCase());
this._lexer = this.createLexerFormCharStream(this._charStreams);
this._lexer = this.createLexerFromCharStream(this._charStreams);
this._lexer.removeErrorListeners();
this._lexer.addErrorListener(new ParseErrorListener(this._errorListener));