Closed Centril closed 3 years ago
If I read the bnfc sources correctly source positions are not supported by the happy backend of bnfc. Actually the lexer generated by alex yields a list of tokens which are annotated with their source positions, but the happy parser ignores them.
@pascalh is correct, the help comment describe the intended behavior but I still need to find time to complete the feature. The functor part works but not the position part...
Sorry for the inconsistent documentation :confused:.
Any updates on this @gdetrez ?
@Centril partly: I have done some work on this but I was interrupted by other things...
I'll try to rebase and push what I already have this week and see if I can finish it soon-ish. Would you be able to provide some feedback?
@gdetrez Sure, what type of feedback do you want? Peer review or testing (or both)?
Just give me a link to the commit at which point to test it
Is there any chance of getting this merged? Can I help somehow?
Any news on this? This would be a very useful feature!
Seems like this feature sits on an unmerged branch https://github.com/BNFC/bnfc/compare/176-source-position which my predecessor left behind. After three years of course it does not merge cleanly any more. I don't know if there was a reason this was not finished.
I'd be happy for someone to pick it up and integrate it with the current source of BNFC.
This has been implemented by @Commelina in #327 and will be released with 2.9.1.
Released in 2.9.1.
According to
bnfc --help
:--functor Make the AST a functor and use it to store the position of the nodes
How would you go about storing the position of the nodes? The type that
yields is:
I.e: no position information is added... So does that mean that you have to use something else than
happy
, or can you get it to add that position information for you?