Fix/export abstract visitor (#237)

* fix: #236 export AbstractParseTreeVisitor

* build: set isolatedModules true

* feat: import parser about from filters
This commit is contained in:
Hayden
2023-12-19 19:22:27 +08:00
committed by GitHub
parent 55a4832047
commit 8f72a5af60
162 changed files with 327 additions and 277 deletions

View File

@ -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', () => {

View File

@ -1,4 +1,4 @@
import PostgresSQL from '../../../src/parser/pgsql';
import { PostgresSQL } from '../../filters';
describe('PostgresSQL Lexer tests', () => {
const mysqlParser = new PostgresSQL();

View File

@ -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';

View File

@ -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 = {

View File

@ -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);

View File

@ -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');

View File

@ -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'),

View File

@ -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'),

View File

@ -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'),

View File

@ -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'),

View File

@ -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'),

View File

@ -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'),

View File

@ -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'),

View File

@ -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'),

View File

@ -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';