Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2361c57

Browse files
committed
fix: #40
1 parent 7f3b853 commit 2361c57

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

‎src/sqlParser.jison‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ UNION return 'UNION'
126126

127127
[a-zA-Z_\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]* return 'IDENTIFIER'
128128
\. return 'DOT'
129-
['"][a-zA-Z_\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*["'] return 'IDENTIFIER'
130-
([`])(?:(?=(\\?))2円.)*?1円 return 'IDENTIFIER'
129+
["][a-zA-Z_\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*["] return 'STRING'
130+
['][a-zA-Z_\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*['] return 'STRING'
131+
[`].+[`] return 'IDENTIFIER'
131132

132133
<<EOF>> return 'EOF'
133134
. return 'INVALID'

‎test/main.test.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,13 @@ describe('select grammar support', function () {
422422
testParser('select a as "A A" from z');
423423
testParser('select a as "A A" from z order by "A A" desc');
424424
});
425+
426+
it('support quoted alias', function () {
427+
testParser('select a as \'A A\' from z');
428+
testParser('select a as \'"A#A\' from z order by \'"A#A\' desc');
429+
});
430+
431+
it.only('test IDENTIFIER', function () {
432+
testParser('select `aa#sfs`(a) as \'A A\' from z');
433+
});
425434
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /