lexer: fix a bug in error handling code
lexer: fix a bug in error handling code

pkilambi/python-jsonpath-rw,sileht/python-jsonpath-rw,kennknowles/python-jsonpath-rw,brianthelion/python-jsonpath-rw,abloomston/python-jsonpath-rw,wangjild/python-jsonpath-rw