[#5955] Supported additional quote sequences
This commit is contained in:
parent
b5f07a6d43
commit
3a3cd95d47
@ -486,6 +486,7 @@ term =
|
||||
| 'FIRST_VALUE' '(' field ')' over
|
||||
| 'GREATEST' '(' fields ')'
|
||||
| 'GROUP_CONCAT' '(' [ 'DISTINCT' ] field [ 'ORDER BY' sortFields ] [ 'SEPARATOR' stringLiteral ] ')'
|
||||
| 'GROUP_ID' '(' ')'
|
||||
| 'GROUPING_ID' '(' fields ')'
|
||||
| 'GROUPING' '(' fields ')'
|
||||
| 'HOUR' '(' field ')'
|
||||
@ -705,11 +706,11 @@ name = identifier { '.' identifier }
|
||||
stringLiteral =
|
||||
(
|
||||
"'" character* "'"
|
||||
| "q'!" characters* "!'"
|
||||
| "q'[" characters* "]'"
|
||||
| "q'{" characters* "}'"
|
||||
| "q'(" characters* ")'"
|
||||
| "q'<" characters* ">'"
|
||||
| "q'" nonSpaceCharacter characters* nonSpaceCharacter "'"
|
||||
)
|
||||
;
|
||||
|
||||
|
||||
@ -5171,13 +5171,15 @@ class ParserImpl implements Parser {
|
||||
char end;
|
||||
|
||||
switch (start) {
|
||||
case '!': end = '!'; ctx.position = ctx.position + 1; break;
|
||||
case '[': end = ']'; ctx.position = ctx.position + 1; break;
|
||||
case '{': end = '}'; ctx.position = ctx.position + 1; break;
|
||||
case '(': end = ')'; ctx.position = ctx.position + 1; break;
|
||||
case '<': end = '>'; ctx.position = ctx.position + 1; break;
|
||||
default:
|
||||
throw ctx.exception("Illegal quote string character");
|
||||
case '[' : end = ']'; ctx.position = ctx.position + 1; break;
|
||||
case '{' : end = '}'; ctx.position = ctx.position + 1; break;
|
||||
case '(' : end = ')'; ctx.position = ctx.position + 1; break;
|
||||
case '<' : end = '>'; ctx.position = ctx.position + 1; break;
|
||||
case ' ' :
|
||||
case '\t':
|
||||
case '\r':
|
||||
case '\n': throw ctx.exception("Illegal quote string character");
|
||||
default : end = start; ctx.position = ctx.position + 1; break;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user