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.
!! Breaking change due to restructuring and renaming of scoped identifiers !!
Scoped identifier rules have been renamed to "qualified_x_identifier"
and all variants are aliased so they appear as simply
"qualified_identifier" in the syntax tree. This name better reflects the
c++ standard's language describing this concept.
Qualified identifier rules are now always the "parent" with a right
associative rule that lets them nest indefinitely. Each rule terminates
with some kind of non-scope identifier.
This commit also adds support for the 'template' keyword where required
to disambiguate dependent template names. Field accessors (., ->) can be
followed by keyword template before a template method. The scope
resolution operator can be immediately followed by the 'template'
keyword to indicate the following dependent name with '<' is actually a
template and shouldn't be parsed as a binary operator. These keywords
are required for dependent names in these contexts.
* Add user-defined literals
* Simplify operator rule
* Tweak operator tests
* Remove precedence for user-defined literanl
* Define a rule for ud-suffix
* Use a more readable name for ud-suffix
Constructor declarations can have the same decl-specifiers as
constructor definitions. This adds a new rule to match as many
"constructor specifiers" that are present in any order before the
function decl itself, and adds the rule to constructor declarations and
constructor definitions.
The cast operator can also have any of these specifiers in any order
before the declaration, so this commit also changes the cast operator
declaration and definition to use the new rule as well.
Finally, constructor declarations and cast operator declarations can be
part of a template declaration in addition to the definitions, so add
them both to the template_declaration rule.