提交 6545e9c9 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Pass characters to Parser.getSpecialType*()

上级 c0365d3e
...@@ -3911,18 +3911,18 @@ public class Parser { ...@@ -3911,18 +3911,18 @@ public class Parser {
} }
case CHAR_SPECIAL_2: case CHAR_SPECIAL_2:
if (types[i] == CHAR_SPECIAL_2) { if (types[i] == CHAR_SPECIAL_2) {
i++; char c1 = chars[i++];
currentToken = sqlCommand.substring(start, i); currentToken = sqlCommand.substring(start, i);
currentTokenType = getSpecialType2(currentToken); currentTokenType = getSpecialType2(c, c1);
} else { } else {
currentToken = sqlCommand.substring(start, i); currentToken = sqlCommand.substring(start, i);
currentTokenType = getSpecialType1(currentToken); currentTokenType = getSpecialType1(c);
} }
parseIndex = i; parseIndex = i;
return; return;
case CHAR_SPECIAL_1: case CHAR_SPECIAL_1:
currentToken = sqlCommand.substring(start, i); currentToken = sqlCommand.substring(start, i);
currentTokenType = getSpecialType1(currentToken); currentTokenType = getSpecialType1(c);
parseIndex = i; parseIndex = i;
return; return;
case CHAR_VALUE: case CHAR_VALUE:
...@@ -4352,8 +4352,8 @@ public class Parser { ...@@ -4352,8 +4352,8 @@ public class Parser {
} }
} }
private int getSpecialType1(String s) { private int getSpecialType1(char c0) {
switch (s.charAt(0)) { switch (c0) {
case '?': case '?':
case '$': case '$':
return PARAMETER; return PARAMETER;
...@@ -4392,9 +4392,8 @@ public class Parser { ...@@ -4392,9 +4392,8 @@ public class Parser {
} }
} }
private int getSpecialType2(String s) { private int getSpecialType2(char c0, char c1) {
char c1 = s.charAt(1); switch (c0) {
switch (s.charAt(0)) {
case ':': case ':':
if (c1 == ':' || c1 == '=') { if (c1 == ':' || c1 == '=') {
return KEYWORD; return KEYWORD;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论