mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Abolish the old attribute syntax for type attributes (and SIL type attrs)
- Change type attribute printing logic (in astprinter and the demangler) to print in the new syntax - Change the swift parser to only accept type attributes in the new syntax. - Update canParseTypeTupleBody to lookahead over new-syntax type attributes. - Update the testsuite to use the new syntax. Swift SVN r9273
This commit is contained in:
@@ -484,7 +484,7 @@ public:
|
||||
DeclAttributes &Attributes,
|
||||
PatternBindingDecl *PBD = nullptr);
|
||||
|
||||
bool parseAttributeList(DeclAttributes &Attributes, bool OldStyle) {
|
||||
bool parseAttributeList(DeclAttributes &Attributes, bool OldStyle = false) {
|
||||
if (OldStyle) {
|
||||
if (Tok.is(tok::l_square))
|
||||
return parseAttributeListPresent(Attributes, OldStyle);
|
||||
@@ -497,18 +497,13 @@ public:
|
||||
bool parseAttributeListPresent(DeclAttributes &Attributes, bool OldStyle);
|
||||
bool parseAttribute(DeclAttributes &Attributes, bool OldStyle);
|
||||
|
||||
bool parseTypeAttributeList(TypeAttributes &Attributes, bool OldStyle) {
|
||||
if (OldStyle) {
|
||||
if (Tok.is(tok::l_square))
|
||||
return parseTypeAttributeListPresent(Attributes, OldStyle);
|
||||
} else {
|
||||
if (Tok.is(tok::at_sign))
|
||||
return parseTypeAttributeListPresent(Attributes, OldStyle);
|
||||
}
|
||||
bool parseTypeAttributeList(TypeAttributes &Attributes) {
|
||||
if (Tok.is(tok::at_sign))
|
||||
return parseTypeAttributeListPresent(Attributes);
|
||||
return false;
|
||||
}
|
||||
bool parseTypeAttributeListPresent(TypeAttributes &Attributes, bool OldStyle);
|
||||
bool parseTypeAttribute(TypeAttributes &Attributes, bool OldStyle);
|
||||
bool parseTypeAttributeListPresent(TypeAttributes &Attributes);
|
||||
bool parseTypeAttribute(TypeAttributes &Attributes);
|
||||
|
||||
|
||||
ParserResult<ImportDecl> parseDeclImport(unsigned Flags,
|
||||
|
||||
Reference in New Issue
Block a user