stephens2424 / php

Parser for PHP written in Go
BSD 3-Clause "New" or "Revised" License
529 stars 77 forks source link

Parser errors does not have the proper line number #24

Closed gleamingthecube closed 8 years ago

gleamingthecube commented 9 years ago

Parser errors always display line=0 instead of the real line number.

prathmeshranaut commented 9 years ago

It seems to be working fine. Do you have code sample using which I can reproduce the issue?

krageon commented 8 years ago

Have a look at https://github.com/stephens2424/php/blob/master/parser/parser.go#L225

There is no way that works. Something along the lines of e.Line = p.current.Begin.Line does appear to work properly.

stephens2424 commented 8 years ago

I think I broke this when I added support for multiple-file awareness in the parser.

stephens2424 commented 8 years ago

Should be fixed now. Fixed the filenames too.