From 221482cc7c985f8e0f957f343c0aa0b30bc6b30d Mon Sep 17 00:00:00 2001 From: xiaowei Date: Tue, 5 Jan 2021 17:49:34 +0800 Subject: [PATCH] refactor(plsql): extract plsql export into src index --- src/index.ts | 2 ++ src/parser/plsql.ts | 2 -- test/parser/plsql/lexer.test.ts | 4 ++-- test/parser/plsql/listener.test.ts | 4 ++-- test/parser/plsql/syntax.test.ts | 4 ++-- test/parser/plsql/visitor.test.ts | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2ce2058..0ecdb53 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,3 +6,5 @@ export * from './lib/generic/SqlParserVisitor'; export * from './lib/generic/SqlParserListener'; export * from './lib/hive/HiveSqlListener'; export * from './lib/hive/HiveSqlVisitor'; +export * from './lib/plsql/PlSqlParserListener'; +export * from './lib/plsql/PlSqlParserVisitor'; diff --git a/src/parser/plsql.ts b/src/parser/plsql.ts index 95b49a7..c88e350 100644 --- a/src/parser/plsql.ts +++ b/src/parser/plsql.ts @@ -1,8 +1,6 @@ import { InputStream, CommonTokenStream, Lexer } from 'antlr4'; import { PlSqlLexer } from '../lib/plsql/PlSqlLexer'; import { PlSqlParser } from '../lib/plsql/PlSqlParser'; -export * from '../lib/plsql/PlSqlParserListener'; -export * from '../lib/plsql/PlSqlParserVisitor'; import BasicParser from './common/basicParser'; diff --git a/test/parser/plsql/lexer.test.ts b/test/parser/plsql/lexer.test.ts index 0a397e9..5891fed 100644 --- a/test/parser/plsql/lexer.test.ts +++ b/test/parser/plsql/lexer.test.ts @@ -1,7 +1,7 @@ -import SQLParser from '../../../src/parser/plsql'; +import { PLSQL } from '../../../src'; describe('PLSQL Lexer tests', () => { - const parser = new SQLParser(); + const parser = new PLSQL(); const sql = 'select id,name,sex from user1;'; const tokens = parser.getAllTokens(sql); diff --git a/test/parser/plsql/listener.test.ts b/test/parser/plsql/listener.test.ts index 7f7072f..9431044 100644 --- a/test/parser/plsql/listener.test.ts +++ b/test/parser/plsql/listener.test.ts @@ -1,9 +1,9 @@ -import SQLParser, { PlSqlParserListener } from '../../../src/parser/plsql'; +import { PLSQL, PlSqlParserListener } from '../../../src'; describe('PLSQL Listener Tests', () => { const expectTableName = 'user1'; const sql = `select id,name,sex from ${expectTableName};`; - const parser = new SQLParser(); + const parser = new PLSQL(); const parserTree = parser.parse(sql); diff --git a/test/parser/plsql/syntax.test.ts b/test/parser/plsql/syntax.test.ts index b3c50c3..fa4bb3a 100644 --- a/test/parser/plsql/syntax.test.ts +++ b/test/parser/plsql/syntax.test.ts @@ -1,7 +1,7 @@ -import SQLParser from '../../../src/parser/plsql'; +import { PLSQL } from '../../../src'; describe('PLSQL Syntax Tests', () => { - const parser = new SQLParser(); + const parser = new PLSQL(); test('Test simple select Statement', () => { const sql = 'select id,name from user1;'; diff --git a/test/parser/plsql/visitor.test.ts b/test/parser/plsql/visitor.test.ts index 66026ea..5284c16 100644 --- a/test/parser/plsql/visitor.test.ts +++ b/test/parser/plsql/visitor.test.ts @@ -1,9 +1,9 @@ -import SQLParser, { PlSqlParserVisitor } from '../../../src/parser/plsql'; +import { PLSQL, PlSqlParserVisitor } from '../../../src'; describe('PLSQL Visitor Tests', () => { const expectTableName = 'user1'; const sql = `select id,name,sex from ${expectTableName};`; - const parser = new SQLParser(); + const parser = new PLSQL(); const parserTree = parser.parse(sql);