Bug 5114 – Too many error messages with main(;

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-10-24T18:29:00Z
Last change time
2012-01-21T21:52:31Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs

Comments

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 #1 by bugzilla — 2012-01-19T20:25:30Z
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.