Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22e3e8e1 authored by Jack Palevich's avatar Jack Palevich
Browse files

Handle end-of-file inside of comments, local declarations.

parent b4758ff1
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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) {