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