add peg source file

This commit is contained in:
HSunboy 2018-07-03 11:33:53 +08:00
parent b2c7777fb6
commit 6eb8a18c48
6 changed files with 1070 additions and 6 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -1,4 +1,4 @@
### dt-sql-parser
# dt-sql-parser
本项目用于处理sql目前含有功能

17
package-lock.json generated
View File

@ -1,5 +1,20 @@
{
"name": "dt-sql-parser",
"version": "1.0.0",
"lockfileVersion": 1
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"node-query": {
"version": "0.3.3",
"resolved": "http://registry.npm.taobao.org/node-query/download/node-query-0.3.3.tgz",
"integrity": "sha1-s+PXV/7y4oAdUs09R5ikVfAa5Ks=",
"dev": true
},
"pegjs": {
"version": "0.7.0",
"resolved": "http://registry.npm.taobao.org/pegjs/download/pegjs-0.7.0.tgz",
"integrity": "sha1-qqH4JPnnGX7ETiKlevUi9wDdaJ4=",
"dev": true
}
}
}

View File

@ -3,8 +3,14 @@
"version": "1.0.0",
"description": "sql parser",
"main": "index.js",
"scripts": {},
"scripts": {
"build": "pegjs peg/nquery.pegjs core/astParser.js"
},
"author": "xiaokang",
"license": "ISC",
"devDependencies": {}
"devDependencies": {
"node-query": "^0.3.3",
"pegjs": "^0.7.0"
},
"dependencies": {}
}

1043
peg/nquery.pegjs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,8 @@ for(let [key,value] of testMap){
console.log(`******${key}********`)
console.log(value)
console.log(`******result********`)
// console.log(dtSqlParser.parser.parse(value));
console.log(dtSqlParser.filter.filterComments(value))
console.log(dtSqlParser.parser.parse(value));
// console.log(dtSqlParser.filter.filterComments(value))
console.log(`********************`)
}