Line comments that start with bracket_open are treated as unterminated brackets
#[[foobar
fails to parse with this error
Parse error. Expected a command name, got unterminated bracket with text
"foobar".
However the line comment docs claim that
A # not immediately followed by a Bracket Argument forms a line comment that runs until the end of the line
The #
in this case is not followed by a bracket argument because bracket arguments must include a bracket_close. Therefore according to the docs this should be treated as a line comment.
This could also be treated as a spec bug, and the definition of a line comment could be changed to
A # not immediately followed by a bracket_open forms a line comment that runs until the end of the line