-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
I'm parsing a simple programming language with parsy. During parsing, I equip syntax tree nodes with their position in the file using .mark()
, but this doesn't capture the filename. Then I encounter an issue when raising errors during runtime, as the reported error location doesn't mention a filename.
A workaround I can see but find extremely inelegant would be to traverse the whole syntax tree after parsing a file to equip all the nodes' locations with the right filename.
Would it make sense to augment .parse()
to take an optional filename to thread through the parser? This would allow the filename to be mentioned in ParseErrors, but also via new combinator like .mark_file()
for my use case.
Metadata
Metadata
Assignees
Labels
No labels