From 4d19f058900d973155e648816abc3b2c24ee97de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=9C=E5=BA=8F?= <38368040+LuckyFBB@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:45:41 +0800 Subject: [PATCH] fix: rename createLexerFormCharStream to createLexerFromCharStream (#243) --- src/parser/common/basicParser.ts | 6 +++--- src/parser/flinksql.ts | 2 +- src/parser/hive.ts | 2 +- src/parser/impala.ts | 2 +- src/parser/mysql.ts | 2 +- src/parser/pgsql.ts | 2 +- src/parser/plsql.ts | 2 +- src/parser/spark.ts | 2 +- src/parser/trinosql.ts | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/parser/common/basicParser.ts b/src/parser/common/basicParser.ts index 0d609d7..d4453ac 100644 --- a/src/parser/common/basicParser.ts +++ b/src/parser/common/basicParser.ts @@ -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) { 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)); diff --git a/src/parser/flinksql.ts b/src/parser/flinksql.ts index 92d5dac..14e4c59 100644 --- a/src/parser/flinksql.ts +++ b/src/parser/flinksql.ts @@ -11,7 +11,7 @@ import { SyntaxContextType, Suggestions, SyntaxSuggestion } from './common/basic import BasicParser from './common/basicParser'; export default class FlinkSQL extends BasicParser { - protected createLexerFormCharStream(charStreams) { + protected createLexerFromCharStream(charStreams) { const lexer = new FlinkSqlLexer(charStreams); return lexer; } diff --git a/src/parser/hive.ts b/src/parser/hive.ts index cffbc98..b1475b3 100644 --- a/src/parser/hive.ts +++ b/src/parser/hive.ts @@ -7,7 +7,7 @@ import { HiveSqlParserListener } from '../lib/hive/HiveSqlParserListener'; import { SyntaxContextType, Suggestions, SyntaxSuggestion } from './common/basic-parser-types'; export default class HiveSQL extends BasicParser { - protected createLexerFormCharStream(charStreams) { + protected createLexerFromCharStream(charStreams) { const lexer = new HiveSqlLexer(charStreams); return lexer; } diff --git a/src/parser/impala.ts b/src/parser/impala.ts index c11ab26..b4167d2 100644 --- a/src/parser/impala.ts +++ b/src/parser/impala.ts @@ -15,7 +15,7 @@ export default class ImpalaSQL extends BasicParser< ProgramContext, ImpalaSqlParser > { - protected createLexerFormCharStream(charStreams) { + protected createLexerFromCharStream(charStreams) { const lexer = new ImpalaSqlLexer(charStreams); return lexer; } diff --git a/src/parser/mysql.ts b/src/parser/mysql.ts index 15138e4..8292e1a 100644 --- a/src/parser/mysql.ts +++ b/src/parser/mysql.ts @@ -7,7 +7,7 @@ import { Suggestions, SyntaxContextType, SyntaxSuggestion } from './common/basic import { MySqlParserListener } from '../lib/mysql/MySqlParserListener'; export default class MySQL extends BasicParser { - protected createLexerFormCharStream(charStreams): MySqlLexer { + protected createLexerFromCharStream(charStreams): MySqlLexer { const lexer = new MySqlLexer(charStreams); return lexer; } diff --git a/src/parser/pgsql.ts b/src/parser/pgsql.ts index af58eaa..650df01 100644 --- a/src/parser/pgsql.ts +++ b/src/parser/pgsql.ts @@ -11,7 +11,7 @@ export default class PostgresSQL extends BasicParser< ProgramContext, PostgreSQLParser > { - protected createLexerFormCharStream(charStreams) { + protected createLexerFromCharStream(charStreams) { const lexer = new PostgreSQLLexer(charStreams); return lexer; } diff --git a/src/parser/plsql.ts b/src/parser/plsql.ts index 0ac36c1..9541e38 100644 --- a/src/parser/plsql.ts +++ b/src/parser/plsql.ts @@ -6,7 +6,7 @@ import BasicParser from './common/basicParser'; import { Suggestions } from './common/basic-parser-types'; export default class PLSQL extends BasicParser { - protected createLexerFormCharStream(charStreams) { + protected createLexerFromCharStream(charStreams) { const lexer = new PlSqlLexer(charStreams); return lexer; } diff --git a/src/parser/spark.ts b/src/parser/spark.ts index 98df285..17d0ed3 100644 --- a/src/parser/spark.ts +++ b/src/parser/spark.ts @@ -11,7 +11,7 @@ import { Suggestions, SyntaxContextType, SyntaxSuggestion } from './common/basic import { SparkSqlParserListener } from '../lib/spark/SparkSqlParserListener'; export default class SparkSQL extends BasicParser { - protected createLexerFormCharStream(charStreams) { + protected createLexerFromCharStream(charStreams) { const lexer = new SparkSqlLexer(charStreams); return lexer; } diff --git a/src/parser/trinosql.ts b/src/parser/trinosql.ts index 85c4f24..ad5dd7e 100644 --- a/src/parser/trinosql.ts +++ b/src/parser/trinosql.ts @@ -11,7 +11,7 @@ import BasicParser from './common/basicParser'; import { Suggestions, SyntaxContextType, SyntaxSuggestion } from './common/basic-parser-types'; export default class TrinoSQL extends BasicParser { - protected createLexerFormCharStream(charStreams) { + protected createLexerFromCharStream(charStreams) { const lexer = new TrinoSqlLexer(charStreams); return lexer; }