blynn / nex

Lexer for Go
http://cs.stanford.edu/~blynn/nex/
GNU General Public License v3.0
416 stars 47 forks source link

add line number and character position #13

Closed joelreymont closed 10 years ago

blynn commented 10 years ago

I'm not sure about this change. It looks like 'l' and 'c' are just declared but not used anywhere.

joelreymont commented 10 years ago

Ben, They are made available to rules, e.g. for error reporting. 

joelreymont commented 10 years ago

See for example https://github.com/dotcloud/docker/pull/2266

joelreymont commented 10 years ago

More precisely, https://github.com/wagerlabs/docker/blob/65694e801a7b80930961d70c69cba9f2465459be/buildfile.nex#L63

joelreymont commented 10 years ago

So what do you think?

blynn commented 10 years ago

Apologies for the delay. I can see that it's useful to store data in the Lexer struct, but it should be configurable, like the yyextra field of Flex. Unfortunately, I don't have time to do all this right now, so I merged your changes and left a comment instead.

If someone ever does get around to adding a yyextra-like feature to nex, it means you'll have to change the docker code.

joelreymont commented 10 years ago

That's fine, thank you Ben!

On Tue, Nov 19, 2013 at 5:46 PM, Ben Lynn notifications@github.com wrote:

Apologies for the delay. I can see that it's useful to store data in the Lexer struct, but it should be configurable, like the yyextra field of Flex. Unfortunately, I don't have time to do all this right now, so I merged your changes and left a comment instead.

If someone ever does get around to adding a yyextra-like feature to nex, it means you'll have to change the docker code.

— Reply to this email directly or view it on GitHubhttps://github.com/blynn/nex/pull/13#issuecomment-28814321 .


for hire: mac osx device driver ninja. kernel, usb and coreaudio drivers ---------------------+------------+--------------------------------------- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont ---------------------+------------+---------------------------------------