Q: How to get line numbers during compile/desugaring?
I see that I can define rules to report errors and it will magically highlight these in the editor.
What I’d like to do is output an error message like “This was already define on line 17”. However, I don’t really know what line I am on at any given time. I’ve been hunting around but I haven’t found an API or example to help with this yet.
Any tips on how to store the line number of something to report it later?Submitted by Dobes Vandermeer on 30 October 2012 at 20:47
Use the origin-line strategy in editor-common.generated.str, it should work on any term with origin information.
Also, the mailing list is probably a better place for questions.
OK great, thanks! I’ll try the mailing list next time.
In fact, I think it is useful to have such questions recorded in YellowGrass, so that people can find the answers. Perhaps we should have StackOverflow type site at some point, but for now this will do.
I’ll carry on this discussion in the mailing list … as it’s definitely not belonging in the comments thread for THIS ticket.
Log in to post comments