I think that's a side effect from keeping the parser simple. A lexer
is always greedy, so whenever "([" is together in a file then it'd be
parsed as a single token. However, there are cases where you can get
the two tokens "(" and "[" next to each other. e.g:

  string foo = ([string] bar) + "\n";

It'd be necessary to have a lot of extra special case rules in
language.yacc to handle these without forcing users to put some space
between "(" and "[".

Reply via email to