-
Notifications
You must be signed in to change notification settings - Fork 478
Add validation to make sure source info generated from the parser is actually valid #5417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…actually valid Signed-off-by: fruffy <fruffy@nyu.edu>
|
Another possible approach would be to change YYLLOC_DEFAULT to something like: This would set the location to the location of the lookahead token for an epsilon reduction. |
Signed-off-by: fruffy <fruffy@nyu.edu>
|
Perhaps better: or |
Signed-off-by: fruffy <fruffy@nyu.edu>
It might actually be nicer to have the less complex version, I looked at the reference file failures, and they seemed to be benign. Mostly a difference of 1 character in terms of start/end. |
|
Simplest of all would be which might be good enough. Would just sometimes make rules pull in an extra token if they involve an epsilon reduction. or which would make all epsilons have an invalid srcInfo. But then the simple add would lose tokens for any rule with 3+ symbols when the first or last was an epsilon -- would be better to sum |
|
Another possibility would be in all the .y/.ypp files and have a single in a header file to avoid the complex macro with line continuations |
12959ed to
bd938b1
Compare
|
Ended up reverting to the more elaborate version since there were small differences in the line count that led to failing tests. |
…actually valid (p4lang#5417) Signed-off-by: fruffy <fruffy@nyu.edu>
No description provided.