You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find that it sometimes greatly helps error recovery to define rules like below, to signal that something is invalid syntax but we can continue parsing without bringing in the whole error recovery mechanism.
But does this produce a functional ERROR node as seen by ts_node_has/is_error, or do "real" ERROR nodes have some magic tag?
Also somewhat relatedly, is there any way to prohibit a token from participating in error recovery? Because the aforementioned string_content token matches almost everything, which is Not Great for recovery. I could use an external scanner, but that's a rather awkward workaround.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I find that it sometimes greatly helps error recovery to define rules like below, to signal that something is invalid syntax but we can continue parsing without bringing in the whole error recovery mechanism.
But does this produce a functional ERROR node as seen by
ts_node_has/is_error
, or do "real" ERROR nodes have some magic tag?Also somewhat relatedly, is there any way to prohibit a token from participating in error recovery? Because the aforementioned
string_content
token matches almost everything, which is Not Great for recovery. I could use an external scanner, but that's a rather awkward workaround.Beta Was this translation helpful? Give feedback.
All reactions