Fix logic error in parsing

Due to a problem with precedence of logical operators / equality tests,
code with comments in the middle of assignments could cause the parser
to fail.

The offending logic is fixed and a test case is added.