Helper function to create a SyntaxError from the text and a cursor positioned at an error node.
As the cursor from a parse tree is available, details on missing or unexpected tokens can be extracted.
Parameters
text: Text
The text to parse.
cursor: TreeCursor
The cursor position in the text which should be at an error node.
Helper function to create a SyntaxError from the text and a cursor positioned at an error node. As the cursor from a parse tree is available, details on missing or unexpected tokens can be extracted.