Closed hristiy4n closed 2 years ago
Please add a test case for
foo << < bar
as well - I think your logic will incorrectly fire in that case too, as you just look atp.tok
.A better solution might be to always tokenize
<<<
as a single token, and then error if the parser encounters the token in posix mode.
You are right, foo << < bar
will not throw the correct error message with this logic.
I saw that lexer.go:506 doesn't return <<<
when p.lang != LangPOSIX
. I didn't remove the condition as I didn't want to break any existing functionality. Removing this condition and always having <<<
as a token sounds like a better solution.
Fixes #881