({{, (RefLink[$SyntaxHandler, paclet:ref/$SyntaxHandler])
is a global variable that, if set, is applied to any input string that is found to contain a syntax error. }})

OpenersNotesSection(Spacer1)Details

The arguments given to (RefLink[$SyntaxHandler, paclet:ref/$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 (RefLink[$SyntaxHandler, paclet:ref/$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 (RefLink[$SyntaxHandler, paclet:ref/$SyntaxHandler]) returns (RefLink[$Failed, paclet:ref/$Failed]), input to the Wolfram Language is abandoned if possible.

Input is not assigned to (RefLink[InString, paclet:ref/InString])[n] until after (RefLink[$SyntaxHandler, paclet:ref/$SyntaxHandler]) is applied.

(RefLink[$SyntaxHandler, paclet:ref/$SyntaxHandler]) is not called for input from files obtained using (RefLink[Get, paclet:ref/Get]).

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[SyntaxLength, paclet:ref/SyntaxLength])  ▪  (RefLink[SyntaxQ, paclet:ref/SyntaxQ])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Wolfram System Sessions, paclet:tutorial/WolframSystemSessions])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Session Customization, paclet:guide/SessionCustomization])}})}})