Merge pull request #942 from wenshao/master

improved odps sql formatter
This commit is contained in:
高铁
2015-08-31 20:56:29 +08:00
11 changed files with 45 additions and 18 deletions
@@ -79,6 +79,8 @@ public class Lexer {
protected boolean keepComments = false;
protected int line = 0;
protected int lines = 0;
public Lexer(String input){
this(input, null);
@@ -293,10 +295,15 @@ public class Lexer {
comments = null;
}
this.lines = 0;
int startLine = line;
for (;;) {
if (isWhitespace(ch)) {
if (ch == '\n') {
line++;
lines = line - startLine;
}
scanChar();