Needed to handle e.g. `a[a[0]]`. SWIG's parser doesn't seem to handle that currently though. See #2286.
Suggested by wsfulton in #1158
Just ignore anything in between [[ and ]] in the scanner, which is better that failing with a parse error. Fixes #1158 Fixes #2286