refactor(plsql): extract plsql export into src index

This commit is contained in:
xiaowei 2021-01-05 17:49:34 +08:00
parent 57aba357ab
commit 221482cc7c
6 changed files with 10 additions and 10 deletions

View File

@ -6,3 +6,5 @@ export * from './lib/generic/SqlParserVisitor';
export * from './lib/generic/SqlParserListener'; export * from './lib/generic/SqlParserListener';
export * from './lib/hive/HiveSqlListener'; export * from './lib/hive/HiveSqlListener';
export * from './lib/hive/HiveSqlVisitor'; export * from './lib/hive/HiveSqlVisitor';
export * from './lib/plsql/PlSqlParserListener';
export * from './lib/plsql/PlSqlParserVisitor';

View File

@ -1,8 +1,6 @@
import { InputStream, CommonTokenStream, Lexer } from 'antlr4'; import { InputStream, CommonTokenStream, Lexer } from 'antlr4';
import { PlSqlLexer } from '../lib/plsql/PlSqlLexer'; import { PlSqlLexer } from '../lib/plsql/PlSqlLexer';
import { PlSqlParser } from '../lib/plsql/PlSqlParser'; import { PlSqlParser } from '../lib/plsql/PlSqlParser';
export * from '../lib/plsql/PlSqlParserListener';
export * from '../lib/plsql/PlSqlParserVisitor';
import BasicParser from './common/basicParser'; import BasicParser from './common/basicParser';

View File

@ -1,7 +1,7 @@
import SQLParser from '../../../src/parser/plsql'; import { PLSQL } from '../../../src';
describe('PLSQL Lexer tests', () => { describe('PLSQL Lexer tests', () => {
const parser = new SQLParser(); const parser = new PLSQL();
const sql = 'select id,name,sex from user1;'; const sql = 'select id,name,sex from user1;';
const tokens = parser.getAllTokens(sql); const tokens = parser.getAllTokens(sql);

View File

@ -1,9 +1,9 @@
import SQLParser, { PlSqlParserListener } from '../../../src/parser/plsql'; import { PLSQL, PlSqlParserListener } from '../../../src';
describe('PLSQL Listener Tests', () => { describe('PLSQL Listener Tests', () => {
const expectTableName = 'user1'; const expectTableName = 'user1';
const sql = `select id,name,sex from ${expectTableName};`; const sql = `select id,name,sex from ${expectTableName};`;
const parser = new SQLParser(); const parser = new PLSQL();
const parserTree = parser.parse(sql); const parserTree = parser.parse(sql);

View File

@ -1,7 +1,7 @@
import SQLParser from '../../../src/parser/plsql'; import { PLSQL } from '../../../src';
describe('PLSQL Syntax Tests', () => { describe('PLSQL Syntax Tests', () => {
const parser = new SQLParser(); const parser = new PLSQL();
test('Test simple select Statement', () => { test('Test simple select Statement', () => {
const sql = 'select id,name from user1;'; const sql = 'select id,name from user1;';

View File

@ -1,9 +1,9 @@
import SQLParser, { PlSqlParserVisitor } from '../../../src/parser/plsql'; import { PLSQL, PlSqlParserVisitor } from '../../../src';
describe('PLSQL Visitor Tests', () => { describe('PLSQL Visitor Tests', () => {
const expectTableName = 'user1'; const expectTableName = 'user1';
const sql = `select id,name,sex from ${expectTableName};`; const sql = `select id,name,sex from ${expectTableName};`;
const parser = new SQLParser(); const parser = new PLSQL();
const parserTree = parser.parse(sql); const parserTree = parser.parse(sql);