Comment #0 by bearophile_hugs — 2010-10-24T18:29:24Z
This is a wrong program:
void main() {
main(;
}
But DMD 2.049 shows too many errors:
test.d(2): expression expected, not ';'
test.d(3): found '}' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
test.d(3): found 'EOF' when expecting ','
test.d(3): expression expected, not 'EOF'
Comment #2 by bearophile_hugs — 2012-01-21T18:21:23Z
After the latest DMD updates (minutes ago), the program now gives me:
test.d(2): expression expected, not ';'
test.d(3): found '}' when expecting ','
test.d(3): found 'EOF' when expecting ')'
test.d(3): found 'EOF' when expecting ';' following statement
test.d(3): found 'EOF' when expecting '}' following compound statement
This is an improvement.
Note: among the errors I don't see the "premature end of file" error message that's inside Walter change:
+
+ if (token.value == TOKeof)
+ { error("premature end of file");
+ break;
+ }
Comment #3 by yebblies — 2012-01-21T21:52:31Z
(In reply to comment #2)
> Note: among the errors I don't see the "premature end of file" error message
> that's inside Walter change:
>
> +
> + if (token.value == TOKeof)
> + { error("premature end of file");
> + break;
> + }
This is inside Parser::parseEnum - when eof is encountered inside and enum declaration's body.