improve sql wall

This commit is contained in:
wenshao
2013-08-29 15:40:50 +08:00
parent d179a8752e
commit 5126b4df2c
4 changed files with 79 additions and 4 deletions
@@ -384,8 +384,15 @@ public class MySqlLexer extends Lexer {
public void scanComment() {
Token lastToken = this.token;
if (ch != '/' && ch != '-') {
if (ch == '-') {
char next_2 = charAt(pos + 2);
if (isDigit(next_2)) {
scanChar();
token = Token.SUB;
return;
}
} else if (ch != '/') {
throw new IllegalStateException();
}
@@ -173,7 +173,7 @@ public class Lexer {
protected final void scanChar() {
ch = charAt(++pos);
}
protected void unscan() {
ch = charAt(--pos);
}