[Issue 4144] New: Better line number of semicolon expected errors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 2 02:37:12 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4144

           Summary: Better line number of semicolon expected errors
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-05-02 02:37:08 PDT ---
To show how semicolons are namaged by the dmd D2 compiler I have written this
hello world program:

import std.stdio;
struct Foo {
    int x, y;
}
int global;
void main() {
    writeln("Hello World");
}


It contains four semicolons, if you remove the first one dmd V.2.043 produces:
test.d(2): ';' expected
test.d(2): no identifier for declarator Foo
test.d(2): semicolon expected, not '{'
test.d(2): Declaration expected, not '{'
test.d(4): unrecognized declaration

If you remove the second one dmd produces:
test.d(4): semicolon expected, not '}'

If you remove the third one dmd produces:
test.d(6): semicolon expected, not 'void'

If you remove the 4th on line 7 dmd produces:
test.d(8): found '}' when expecting ';' following 'statement'


Not even one of those error line numbers point to the line actually missing the
semicolon. My editor jumps to the line of the error, so having the right line
number saves a bit of my time. Is it possible for dmd semicolon expected error
messages to point to the line that misses the semicolon?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list