You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is primarily for melt-umn/ableC-closure#3, but could be useful for extensions in general.
In some places in C++ (e.g. lambdas) type expressions that aren't a struct/enum/union declaration are permitted to be followed by a {. Currently in ableC we don't segregate type expressions in this way, so it isn't possible for extensions to mimic such C++ syntax.
I propose that we split TypeSpecifier_c into 2 nonterminals:
DefTypeSpecifier_c contains only struct, enum and union definition (but not tag reference) type expressions. The follow set for this does not contain '{'
BasicTypeSpecifier_c contains everything else in TypeSpecifier_c. The follow set here would be seeded with '{'.
The TypeSpecifier_c nonterminal as-is would contain productions to both of these new nonterminals. We would introduce a new BasicSpecifierQualifierList_c mirroring SpecifierQualifierList_c, but instead with BasicTypeSpecifier_c, while SpecifierQualifierList_c would remain unchanged. Extensions wishing to use a type expression followed by '{' (such as closure) would then use BasicSpecifierQualifierList_c. Extensions defining new type expressions that end in braces (such as algebraic datatypes) would now define their productions on DefTypeSpecifier_c, while all other new type expressions (such as the closure type expression) would be defined on BasicTypeSpecifier_c.
Thoughts? If approved I might attempt this over the weekend.
The text was updated successfully, but these errors were encountered:
This is primarily for melt-umn/ableC-closure#3, but could be useful for extensions in general.
In some places in C++ (e.g. lambdas) type expressions that aren't a struct/enum/union declaration are permitted to be followed by a
{
. Currently in ableC we don't segregate type expressions in this way, so it isn't possible for extensions to mimic such C++ syntax.I propose that we split
TypeSpecifier_c
into 2 nonterminals:DefTypeSpecifier_c
contains only struct, enum and union definition (but not tag reference) type expressions. The follow set for this does not contain '{'BasicTypeSpecifier_c
contains everything else inTypeSpecifier_c
. The follow set here would be seeded with '{'.The
TypeSpecifier_c
nonterminal as-is would contain productions to both of these new nonterminals. We would introduce a newBasicSpecifierQualifierList_c
mirroringSpecifierQualifierList_c
, but instead withBasicTypeSpecifier_c
, whileSpecifierQualifierList_c
would remain unchanged. Extensions wishing to use a type expression followed by '{' (such as closure) would then useBasicSpecifierQualifierList_c
. Extensions defining new type expressions that end in braces (such as algebraic datatypes) would now define their productions onDefTypeSpecifier_c
, while all other new type expressions (such as the closure type expression) would be defined onBasicTypeSpecifier_c
.Thoughts? If approved I might attempt this over the weekend.
The text was updated successfully, but these errors were encountered: