mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for oracle sql parser
This commit is contained in:
@@ -90,6 +90,10 @@ public class Lexer {
|
||||
Token token;
|
||||
}
|
||||
|
||||
public Keywords getKeywods() {
|
||||
return keywods;
|
||||
}
|
||||
|
||||
public void mark() {
|
||||
SavePoint savePoint = new SavePoint();
|
||||
savePoint.bp = bp;
|
||||
@@ -143,7 +147,7 @@ public class Lexer {
|
||||
protected final void scanChar() {
|
||||
ch = buf[++bp];
|
||||
}
|
||||
|
||||
|
||||
protected void unscan() {
|
||||
ch = buf[--bp];
|
||||
}
|
||||
@@ -292,11 +296,24 @@ public class Lexer {
|
||||
case '@':
|
||||
scanVariable();
|
||||
return;
|
||||
case '-':
|
||||
int subNextChar = buf[bp + 1];
|
||||
if (subNextChar == '-') {
|
||||
scanComment();
|
||||
if ((token() == Token.LINE_COMMENT || token() == Token.MULTI_LINE_COMMENT) && skipComment) {
|
||||
sp = 0;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
scanOperator();
|
||||
}
|
||||
return;
|
||||
case '/':
|
||||
int nextChar = buf[bp + 1];
|
||||
if (nextChar == '/' || nextChar == '*') {
|
||||
scanComment();
|
||||
if ((token() == Token.LINE_COMMENT || token() == Token.MULTI_LINE_COMMENT) && skipComment) {
|
||||
sp = 0;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@@ -852,6 +869,20 @@ public class Lexer {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public int bp() {
|
||||
return this.bp;
|
||||
}
|
||||
|
||||
public char current() {
|
||||
return this.ch;
|
||||
}
|
||||
|
||||
public void reset(int mark, char mark_ch, Token token) {
|
||||
this.bp = mark;
|
||||
this.ch = mark_ch;
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public final String numberString() {
|
||||
return new String(buf, np, sp);
|
||||
|
||||
Reference in New Issue
Block a user