Skip to content

Commit

Permalink
decltype(...) expressions can be used in qualified identifiers prior …
Browse files Browse the repository at this point in the history
…to scope resolution operators
  • Loading branch information
jdrouhard committed Jan 9, 2023
1 parent b3bba38 commit 2b90863
Show file tree
Hide file tree
Showing 5 changed files with 267,209 additions and 264,339 deletions.
5 changes: 3 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ module.exports = grammar(C, {

// Types

placeholder_type_specifier: $ => seq(
placeholder_type_specifier: $ => prec(1, seq(
field('constraint', optional($._type_specifier)),
choice($.auto, alias($.decltype_auto, $.decltype))
),
)),

auto: $ => 'auto',
decltype_auto: $ => seq(
Expand Down Expand Up @@ -1101,6 +1101,7 @@ module.exports = grammar(C, {
field('scope', optional(choice(
$._namespace_identifier,
$.template_type,
$.decltype,
alias($.dependent_type_identifier, $.dependent_name)
))),
'::',
Expand Down
64 changes: 36 additions & 28 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -7864,43 +7864,47 @@
}
},
"placeholder_type_specifier": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "constraint",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "constraint",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_type_specifier"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_type_specifier"
"name": "auto"
},
{
"type": "BLANK"
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "decltype_auto"
},
"named": true,
"value": "decltype"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "auto"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "decltype_auto"
},
"named": true,
"value": "decltype"
}
]
}
]
]
}
},
"auto": {
"type": "STRING",
Expand Down Expand Up @@ -12262,6 +12266,10 @@
"type": "SYMBOL",
"name": "template_type"
},
{
"type": "SYMBOL",
"name": "decltype"
},
{
"type": "ALIAS",
"content": {
Expand Down
4 changes: 4 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -4795,6 +4795,10 @@
"multiple": false,
"required": false,
"types": [
{
"type": "decltype",
"named": true
},
{
"type": "dependent_name",
"named": true
Expand Down
Loading

0 comments on commit 2b90863

Please sign in to comment.