mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -214,9 +214,8 @@ public class Lexer {
|
||||
this.skipComment = skipComment;
|
||||
|
||||
this.text = input;
|
||||
this.pos = -1;
|
||||
|
||||
scanChar();
|
||||
this.pos = 0;
|
||||
ch = charAt(pos);
|
||||
}
|
||||
|
||||
public Lexer(char[] input, int inputLength, boolean skipComment){
|
||||
@@ -419,6 +418,12 @@ public class Lexer {
|
||||
}
|
||||
}
|
||||
|
||||
if (ch == ')') {
|
||||
scanChar();
|
||||
token = Token.RPAREN;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isFirstIdentifierChar(ch)) {
|
||||
scanIdentifier();
|
||||
return;
|
||||
@@ -487,6 +492,25 @@ public class Lexer {
|
||||
nextToken();
|
||||
}
|
||||
|
||||
public final void nextTokenIdent() {
|
||||
while (ch == ' ') {
|
||||
scanChar();
|
||||
}
|
||||
|
||||
if (isFirstIdentifierChar(ch)) {
|
||||
scanIdentifier();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ch == ')') {
|
||||
scanChar();
|
||||
token = RPAREN;
|
||||
return;
|
||||
}
|
||||
|
||||
nextToken();
|
||||
}
|
||||
|
||||
public final void nextToken() {
|
||||
startPos = pos;
|
||||
bufPos = 0;
|
||||
|
||||
Reference in New Issue
Block a user