修正运算符优先级别处理不当的问题

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@160 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-05-20 16:05:38 +00:00
parent 2b19baff03
commit 431e080bdf
54 changed files with 1085 additions and 114 deletions
@@ -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;
}