Fix/export abstract visitor (#237)
* fix: #236 export AbstractParseTreeVisitor * build: set isolatedModules true * feat: import parser about from filters
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
import PgSQL from '../../../src/parser/pgsql';
|
||||
import { PgSqlSplitListener } from '../../../src/parser/pgsql';
|
||||
import { PostgreSQLParserListener } from '../../../src/lib/pgsql/PostgreSQLParserListener';
|
||||
import { PostgresSQL, PgSqlSplitListener, PostgreSQLParserListener } from '../../filters';
|
||||
|
||||
const validSQL1 = `INSERT INTO country_page_view
|
||||
VALUES ('Chinese', 'mumiao', 18),
|
||||
@ -9,7 +7,7 @@ const validSQL2 = 'SELECT * FROM tb;';
|
||||
const inValidSQL = 'CREATE TABLE';
|
||||
|
||||
describe('PgSQL ErrorStrategy test', () => {
|
||||
const pgSQL = new PgSQL();
|
||||
const pgSQL = new PostgresSQL();
|
||||
|
||||
// TODO: handle unexpected case
|
||||
// test('begin inValid', () => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import PostgresSQL from '../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../filters';
|
||||
|
||||
describe('PostgresSQL Lexer tests', () => {
|
||||
const mysqlParser = new PostgresSQL();
|
||||
|
@ -1,6 +1,4 @@
|
||||
import { ParseTreeListener } from 'antlr4ts/tree';
|
||||
import { PostgreSQLParserListener } from '../../../src/lib/pgsql/PostgreSQLParserListener';
|
||||
import PostgresSQL from '../../../src/parser/pgsql';
|
||||
import { PostgresSQL, PostgreSQLParserListener, ParseTreeListener } from '../../filters';
|
||||
|
||||
describe('PostgresSQL Listener Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,7 +1,6 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType } from '../../../../src/parser/common/basic-parser-types';
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { CaretPosition, SyntaxContextType, PostgresSQL } from '../../../filters';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'multipleStatement.sql'),
|
||||
@ -9,7 +8,7 @@ const syntaxSql = fs.readFileSync(
|
||||
);
|
||||
|
||||
describe('PgSQL Multiple Statements Syntax Suggestion', () => {
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
test('Create table ', () => {
|
||||
const pos: CaretPosition = {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType } from '../../../../src/parser/common/basic-parser-types';
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL, CaretPosition, SyntaxContextType } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
@ -10,7 +9,7 @@ const syntaxSql = fs.readFileSync(
|
||||
);
|
||||
|
||||
describe('Postgre SQL Syntax Suggestion', () => {
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
test('Validate Syntax SQL', () => {
|
||||
expect(parser.validate(syntaxSql).length).not.toBe(0);
|
||||
|
@ -1,7 +1,6 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition } from '../../../../src/parser/common/basic-parser-types';
|
||||
import PostgresSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL, CaretPosition } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
|
||||
const tokenSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'tokenSuggestion.sql'), 'utf-8');
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
const features = {
|
||||
alters: readSQL(__dirname, 'alter.sql'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
const features = {
|
||||
creates: readSQL(__dirname, 'create.sql'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
const features = {
|
||||
deletes: readSQL(__dirname, 'delete.sql'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
const features = {
|
||||
drops: readSQL(__dirname, 'drop.sql'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
const features = {
|
||||
inserts: readSQL(__dirname, 'insert.sql'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
const features = {
|
||||
others: readSQL(__dirname, 'others.sql'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
const features = {
|
||||
selects: readSQL(__dirname, 'select.sql'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PgSQL from '../../../../src/parser/pgsql';
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const parser = new PgSQL();
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
const features = {
|
||||
updates: readSQL(__dirname, 'update.sql'),
|
||||
|
@ -1,6 +1,4 @@
|
||||
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
|
||||
import { PostgreSQLParserVisitor } from '../../../src/lib/pgsql/PostgreSQLParserVisitor';
|
||||
import PostgresSQL from '../../../src/parser/pgsql';
|
||||
import { PostgresSQL, AbstractParseTreeVisitor, PostgreSQLParserVisitor } from '../../filters';
|
||||
|
||||
describe('MySQL Visitor Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
Reference in New Issue
Block a user