Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ node_js:
- "v4.2.1"
- "v4.3.0"
- "v6.9.1"
- "v8.9.1"
scripts: {
"test": "mocha "
"test": "make test"
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test:
node --harmony ./node_modules/.bin/jison -m js ./src/sqlParser.jison -o ./dist/parser/sqlParser.js
cat src/stringify.js >> ./dist/parser/sqlParser.js
cat src/suffix.js >> ./dist/parser/sqlParser.js
./node_modules/mocha/bin/mocha $(TEST)
./node_modules/mocha/bin/mocha $(TEST) --require babel-register

.PHONY: test release
.PHONY: test

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "./dist/parser/sqlParser.js",
"scripts": {
"test": "mocha test/main.test.js --require babel-register",
"test": "make test",
"benchmark": "node test/benchmark.js"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions src/sqlParser.jison
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[#]\s.*\n /* skip sql comments */
\s+ /* skip whitespace */

[`][a-zA-Z_\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*[`] return 'IDENTIFIER'
[\w]+[\u4e00-\u9fa5]+[0-9a-zA-Z_\u4e00-\u9fa5]* return 'IDENTIFIER'
[\u4e00-\u9fa5][0-9a-zA-Z_\u4e00-\u9fa5]* return 'IDENTIFIER'
SELECT return 'SELECT'
Expand Down
4 changes: 4 additions & 0 deletions test/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,9 @@ AND (rd.rd_numberofrooms <= (select sum(rn.reservation_numberofrooms) as count_r
)
`);
});

it ('test11 SELECT `LEFT`(a, 3) FROM b support.', function () {
testParser('SELECT `LEFT`(a, 3) FROM b');
});
});