mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修正运算符优先级别处理不当的问题
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@160 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -446,6 +446,8 @@ public class Lexer {
|
||||
}
|
||||
|
||||
private final void scanAlias() {
|
||||
np = bp;
|
||||
|
||||
for (;;) {
|
||||
if (bp >= buflen) {
|
||||
lexError(tokenPos, "unclosed.str.lit");
|
||||
@@ -457,7 +459,7 @@ public class Lexer {
|
||||
if (ch == '\"') {
|
||||
scanChar();
|
||||
token = LITERAL_ALIAS;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (sp == sbuf.length) {
|
||||
@@ -466,6 +468,8 @@ public class Lexer {
|
||||
sbuf[sp++] = ch;
|
||||
}
|
||||
}
|
||||
|
||||
stringVal = new String(buf, np + 1, sp);
|
||||
}
|
||||
|
||||
public void scanVariable() {
|
||||
@@ -480,6 +484,14 @@ public class Lexer {
|
||||
np = bp;
|
||||
sp = 1;
|
||||
char ch;
|
||||
|
||||
if (buf[bp + 1] == '@') {
|
||||
ch = buf[++bp];
|
||||
hash = 31 * hash + ch;
|
||||
|
||||
sp++;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
ch = buf[++bp];
|
||||
|
||||
@@ -522,6 +534,7 @@ public class Lexer {
|
||||
if (ch == '*' && buf[bp + 1] == '/') {
|
||||
sp += 2;
|
||||
scanChar();
|
||||
scanChar();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user