createSyntaxErrorFromTextAndCursor(text: Text,cursor: TreeCursor): SyntaxError
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.