Add source snippets to missing_from_lexer/parser errors.#571
Conversation
| cl.missing_from_lexer().map(|x| x.to_owned()), | ||
| cl.missing_from_parser().map(|x| x.to_owned()), | ||
| cl.missing_from_parser() | ||
| .map(|x| x.iter().map(|(n, _)| n.to_owned()).collect::<HashSet<_>>()), |
There was a problem hiding this comment.
Perhaps worth noting that this ugly bit is in deprecated code.
|
This one I like! I think we can merge this as-is? |
|
Sure, the only thing I that has come to mind after sleeping on it is whether we should print a warning when The thing to note is that
|
Agreed.
Can we follow the precedent in |
We can, however We might want to change That would be more in line with the current |
Here is take two of PR #570 this one shouldn't affect semver in any way because it ignores the duplication of data between between the
rule_ids, andyacc_grammarfield.This just avoids the code duplication from my original patch without touching on that issue by tweaking things to be less like nimbleparse, and more like the code already in
CTLexerBuilder.We can perhaps reduce field duplication as a follow up, if it is something you would like to see just say so.
Perhaps using the later commits in #570 as a starting point (or not!)