improve comments
This commit is contained in:
		@ -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") {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user