improve comments

This commit is contained in:
HSunboy 2018-10-08 17:37:32 +08:00
parent bd9da8a2dc
commit 38a802d88b

View File

@ -7,10 +7,13 @@ const filter = require("./filter");
const astCache = new Cache();
/**
* 生成ast
*/
function parse(sql) {
const cleanSql = filter.cleanSql(sql);
console.log(cleanSql)
let ast = astCache.get(cleanSql);
if (ast) {
return ast
} else {
@ -21,9 +24,9 @@ function parse(sql) {
}
/**
* sql sql
* type 语法类型默认hive
* return 返回解析对象
* 自动补全提示
* @param {(string | Array<string>)} sql
* @param {string} [type="hive"]
*/
function parseSyntax(sql, type) {
if (typeof type == "undefined") {
@ -40,8 +43,8 @@ function parseSyntax(sql, type) {
/**
* 自动补全提示
* @param {(string | array)} sql
* @param {string=} type
* @param {(string | Array<string>)} sql
* @param {string} [type="hive"]
*/
function parserSql(sql, type) {
if (typeof type == "undefined") {