4 ms·
using the exception only works at whole symbol level, i.e. with "cat do" as imput No terminal matches 'd' in the current parser context, at line 1 col 5 cat d
by avereveard 3y ago
using the exception only works at whole symbol level, i.e. with "cat do" as imput
No terminal matches 'd' in the current parser context, at line 1 col 5
cat do
^
Expected one of:
* CAT
* SPACE
* FISH
* DOG
Next valid symbols: ['* CAT\n\t* SPACE\n\t* FISH\n\t* DOG']
- IanCal 3y agoI'm not sure I understand, what that reports is enough to solve it right? Was the problem you couldn't get it to solve it from that point?
- avereveard 3y agoNo because if I add space to the original string I don't get a valid string Or given the context space is a valid production from the last error, but then I would need to roll back the incomplete "do" terminal and lose that context.
- IanCal 3y ago> No because if I add space to the original string I don't get a valid string Yeah, it's telling you what it was expecting when it hit an invalid token. You take the invalid part and filter the list of suggestions with it. If you tell chatgpt about the problem it solves it. (Edit - when I was running this, having any number of spaces was parsed as valid btw if that's the concern - space was a valid option)