Merge pull request #758 from 52Jolynn/fix_comment_bug

修复单行、多行注释未正常结尾的bug。
This commit is contained in:
Yako
2014-12-31 13:41:35 +08:00
2 changed files with 90 additions and 1 deletions
@@ -770,7 +770,11 @@ public class Lexer {
scanChar();
break;
}
// multiline comment结束符错误
if (ch == EOI) {
throw new ParserException("unterminated /* comment.");
}
scanChar();
bufPos++;
}
@@ -800,6 +804,11 @@ public class Lexer {
scanChar();
break;
}
// single line comment结束符错误
if (ch == EOI) {
throw new ParserException("syntax error at end of input.");
}
scanChar();
bufPos++;