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


Stewart Gordon <s...@iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |s...@iname.com


--- Comment #3 from Stewart Gordon <s...@iname.com> 2012-02-02 12:04:33 PST ---
(In reply to comment #2)
> This happens because the parser scans across the whole initializer to 
> determine
> if it's an expression or an initializer.  Because it's already lexed the whole
> initializer, the lexer's loc points to the end, and this is what is assigned 
> to
> each expression.  Not sure how to solve this without re-lexing the 
> initializer.

But it manages to give line numbers for errors that occur in the semantic
analysis phase.  The D compiler first lexes/parses the entire source file, then
semantically analyses it.  So it should be able to get this right.

Two ways I can see to do it:
- Remember the line number of every token just in case
- Realise on hitting the 7 that it is no longer parseable as either an
expression or an initialiser, and deliver the error there and then.

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

Reply via email to