$SyntaxHandler
✖
$SyntaxHandler
✖
is a global variable that, if set, is applied to any input string that is found to contain a syntax error.
Details

- The arguments given to $SyntaxHandler are the complete input string and an integer specifying the character position at which the syntax error was detected.
- The first character in the string is taken to have position 1.
- Any string returned by $SyntaxHandler is used as a new version of the input string and is fed to the Wolfram Language. If the string does not end with a newline, the Wolfram Language waits for input to complete the line.
- If $SyntaxHandler returns $Failed, input to the Wolfram Language is abandoned if possible.
- Input is not assigned to InString[n] until after $SyntaxHandler is applied.
- $SyntaxHandler is not called for input from files obtained using Get.
Wolfram Research (1991), $SyntaxHandler, Wolfram Language function, https://reference.wolfram.com/language/ref/$SyntaxHandler.html.
✖
Wolfram Research (1991), $SyntaxHandler, Wolfram Language function, https://reference.wolfram.com/language/ref/$SyntaxHandler.html.
Text
Wolfram Research (1991), $SyntaxHandler, Wolfram Language function, https://reference.wolfram.com/language/ref/$SyntaxHandler.html.
✖
Wolfram Research (1991), $SyntaxHandler, Wolfram Language function, https://reference.wolfram.com/language/ref/$SyntaxHandler.html.
CMS
Wolfram Language. 1991. "$SyntaxHandler." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$SyntaxHandler.html.
✖
Wolfram Language. 1991. "$SyntaxHandler." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$SyntaxHandler.html.
APA
Wolfram Language. (1991). $SyntaxHandler. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$SyntaxHandler.html
✖
Wolfram Language. (1991). $SyntaxHandler. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$SyntaxHandler.html
BibTeX
✖
@misc{reference.wolfram_2025_$syntaxhandler, author="Wolfram Research", title="{$SyntaxHandler}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/$SyntaxHandler.html}", note=[Accessed: 06-April-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2025_$syntaxhandler, organization={Wolfram Research}, title={$SyntaxHandler}, year={1991}, url={https://reference.wolfram.com/language/ref/$SyntaxHandler.html}, note=[Accessed: 06-April-2025
]}