This change allows operators (not just fields/member functions) as dependent
template expressions.
```cpp
auto x = y.template operator()<int>();
```
This syntax is used e.g. to call C++20 lambda expressions with a template head
where the template arguments are not function arguments and therefore cannot be
deduced.
```cpp
[]<typename> () {}.template operator()<int>();
```
This change allows commas inside subscripts.
```cpp
auto x = a[1, 2, 3];
```
From C++23, array subscripts work like arguments to `operator[]` as an n-ary
function.
Before C++23, `operator[]` must be a unary function, but before C++20, it's
possible to use the comma operator inside subscript expressions - and this is
done in libraries that use expression templates to achieve multidimensional
array syntax.
Use of the comma operator in subscript expressions was deprecated in C++20 to
make way for the C++23 change to n-ary `operator[]`.
breaking change: namespace_definition_name has been renamed to
nested_namespace_specifier and the nesting has been reversed to match
the way normal scope resolution works elsewhere.
identifiers that are part of a namespace_definition are now
namespace_identifier, which matches the identifier node type used in
scope resolution for qualified types.
namespace alias definitions use the new nested_namespace_specifier so
all identifiers are namespace_identifier nodes.
support for top-level "inline" namespace declarations (which are valid
if they are nested in another namespace body).
Include rawstring delimiters in the tree, use for injections
In raw-strings, the delimiter can be used to indicate embedded language:
R"css( body { background: red; } )css"
This patch adds the delimiter (if present) and raw-string content as
children of the raw_string_literal.
These can be used to parse the content with an injected grammar.
Fixes https://github.com/tree-sitter/tree-sitter-cpp/issues/159
Support for function-try-block implemented in #168/#169 was not correct:
member initializer list in constructor must appear between `try` and the
opening curly brace. Also some cases where try block is allowed were not
implemented.
Following changes are included:
* fix initializer list handling in try block in constructors,
* disallow initializer list in =default/=delete constructors,
* allow for try block in inline function definition,
* allow for try block in cast operator definition.
- Adds a named "init_statement" node for all applicable locations (if,
switch, while, and range-for)
- Adds alias declarations and typedef declarations to possible types of
init statements (c++20/c++23)