Turn an unmatched ]] back into two ]

Needed to handle e.g. `a[a[0]]`.  SWIG's parser doesn't seem to handle
that currently though.  See #2286.
This commit is contained in:
Olly Betts 2022-07-08 15:50:51 +12:00
commit 04abbcf4ae
3 changed files with 10 additions and 2 deletions

View file

@ -40,4 +40,11 @@ struct [[nodiscard]] S { };
const char *test_string_literal() { return "Test [[ and ]] in string literal"; }
#if 0
// Check that SWIG doesn't choke on ]] when it's not part of an attribute.
// FIXME: SWIG's parser doesn't handle this case currently.
int *a;
int b = a[a[0]];
#endif
%}