Fix the caret position in some syntax errors in interactive mode (GH-30718)

1 file changed