Support repeated macro annotations on class definitions

Fixes #615
This commit is contained in:
Marco Castelluccio 2021-04-09 17:45:35 +02:00
Родитель e8addc6ec4
Коммит cf62d06a5a
4 изменённых файлов: 319166 добавлений и 318435 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -48,7 +48,7 @@ module.exports = grammar(CPP, {
class_specifier: $ => prec.right(seq(
'class',
optional($.macro_annotation),
repeat($.macro_annotation),
choice(
field('name', $._class_name),
seq(

Просмотреть файл

@ -2608,135 +2608,127 @@
}
},
"function_declarator": {
"type": "PREC_DYNAMIC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_declarator"
}
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "parameter_list"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "attribute_specifier"
}
"type": "SEQ",
"members": [
{
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_declarator"
}
]
}
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
},
{
"type": "SYMBOL",
"name": "virtual_specifier"
},
{
"type": "SYMBOL",
"name": "noexcept"
},
{
"type": "SYMBOL",
"name": "throw_specifier"
},
{
"type": "SYMBOL",
"name": "trailing_return_type"
"name": "parameter_list"
}
]
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "attribute_specifier"
}
}
]
}
]
}
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "type_qualifier"
},
{
"type": "SYMBOL",
"name": "virtual_specifier"
},
{
"type": "SYMBOL",
"name": "noexcept"
},
{
"type": "SYMBOL",
"name": "throw_specifier"
},
{
"type": "SYMBOL",
"name": "trailing_return_type"
}
]
}
}
]
},
"function_field_declarator": {
"type": "PREC_DYNAMIC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_field_declarator"
}
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "parameter_list"
}
"type": "SEQ",
"members": [
{
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_field_declarator"
}
]
}
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
},
{
"type": "SYMBOL",
"name": "virtual_specifier"
},
{
"type": "SYMBOL",
"name": "noexcept"
},
{
"type": "SYMBOL",
"name": "throw_specifier"
},
{
"type": "SYMBOL",
"name": "trailing_return_type"
"name": "parameter_list"
}
]
}
}
]
}
]
}
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "type_qualifier"
},
{
"type": "SYMBOL",
"name": "virtual_specifier"
},
{
"type": "SYMBOL",
"name": "noexcept"
},
{
"type": "SYMBOL",
"name": "throw_specifier"
},
{
"type": "SYMBOL",
"name": "trailing_return_type"
}
]
}
}
]
},
"function_type_declarator": {
"type": "PREC",
@ -8062,16 +8054,11 @@
"value": "class"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "macro_annotation"
},
{
"type": "BLANK"
}
]
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "macro_annotation"
}
},
{
"type": "CHOICE",

Разница между файлами не показана из-за своего большого размера Загрузить разницу