bug fixed for msyql parser. issue #1359

This commit is contained in:
wenshao
2016-08-10 16:07:45 +08:00
parent c852caa6fe
commit b40dda4025
2 changed files with 74 additions and 1 deletions
@@ -254,6 +254,12 @@ public class MySqlLexer extends Lexer {
ch = charAt(++pos);
if (!isIdentifierChar(ch)) {
if (ch == '-' && pos < text.length() - 1) {
char next_char = text.charAt(pos + 1);
if (isIdentifierChar(next_char)) {
continue;
}
}
if (last_ch == '-' && charAt(pos-2) != '-') {
ch = last_ch;
bufPos--;
@@ -419,7 +425,7 @@ public class MySqlLexer extends Lexer {
}
// identifierFlags['`'] = true;
identifierFlags['_'] = true;
identifierFlags['-'] = true; // mysql
//identifierFlags['-'] = true; // mysql
}
public static boolean isIdentifierChar(char c) {