support using-enum-declaration

pull/502/head
John Drouhard 2022-10-19 20:38:44 +07:00
parent d5e90fba89
commit 5ead1e26c6
4 changed files with 52313 additions and 52295 deletions

@ -652,7 +652,7 @@ module.exports = grammar(C, {
using_declaration: $ => seq( using_declaration: $ => seq(
'using', 'using',
optional('namespace'), optional(choice('namespace', 'enum')),
choice( choice(
$.identifier, $.identifier,
$.qualified_identifier $.qualified_identifier

9
src/grammar.json vendored

@ -9926,6 +9926,9 @@
"type": "STRING", "type": "STRING",
"value": "using" "value": "using"
}, },
{
"type": "CHOICE",
"members": [
{ {
"type": "CHOICE", "type": "CHOICE",
"members": [ "members": [
@ -9933,6 +9936,12 @@
"type": "STRING", "type": "STRING",
"value": "namespace" "value": "namespace"
}, },
{
"type": "STRING",
"value": "enum"
}
]
},
{ {
"type": "BLANK" "type": "BLANK"
} }

104591
src/parser.c vendored

File diff suppressed because it is too large Load Diff

@ -81,6 +81,7 @@ using c::d;
using ::e::f::g; using ::e::f::g;
using h = i::j; using h = i::j;
using namespace std; using namespace std;
using enum Foo;
template <typename T> template <typename T>
using a = typename b<T>::c; using a = typename b<T>::c;
@ -102,6 +103,7 @@ using a = typename b<T>::c;
(type_identifier) (type_identifier)
(type_descriptor (qualified_identifier (namespace_identifier) (type_identifier)))) (type_descriptor (qualified_identifier (namespace_identifier) (type_identifier))))
(using_declaration (identifier)) (using_declaration (identifier))
(using_declaration (identifier))
(template_declaration (template_declaration
(template_parameter_list (template_parameter_list
(type_parameter_declaration (type_identifier))) (type_parameter_declaration (type_identifier)))