Merge change 4084
* changes: Handle end-of-file inside of comments, local declarations.
This commit is contained in:
commit
5a5b16cf7f
1 changed files with 7 additions and 4 deletions
|
|
@ -1995,18 +1995,21 @@ class Compiler : public ErrorSink {
|
|||
}
|
||||
} else if ((tok == '/') & (ch == '*')) {
|
||||
inp();
|
||||
while (ch) {
|
||||
while (ch != '*')
|
||||
while (ch && ch != EOF) {
|
||||
while (ch != '*' && ch != EOF)
|
||||
inp();
|
||||
inp();
|
||||
if (ch == '/')
|
||||
ch = 0;
|
||||
}
|
||||
if (ch == EOF) {
|
||||
error("End of file inside comment.");
|
||||
}
|
||||
inp();
|
||||
next();
|
||||
} else if ((tok == '/') & (ch == '/')) {
|
||||
inp();
|
||||
while (ch && (ch != '\n')) {
|
||||
while (ch && (ch != '\n') && (ch != EOF)) {
|
||||
inp();
|
||||
}
|
||||
inp();
|
||||
|
|
@ -2489,7 +2492,7 @@ class Compiler : public ErrorSink {
|
|||
Type base;
|
||||
|
||||
while (acceptType(base)) {
|
||||
while (tok != ';') {
|
||||
while (tok != ';' && tok != EOF) {
|
||||
Type t = acceptPointerDeclaration(t);
|
||||
addLocalSymbol();
|
||||
if (tok) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue