diff --git a/CodeGeneration/Sources/SyntaxSupport/AttributeKinds.swift b/CodeGeneration/Sources/SyntaxSupport/AttributeKinds.swift index 6381dae719e..663c83ad656 100644 --- a/CodeGeneration/Sources/SyntaxSupport/AttributeKinds.swift +++ b/CodeGeneration/Sources/SyntaxSupport/AttributeKinds.swift @@ -652,6 +652,16 @@ public let DECL_ATTR_KINDS: [Attribute] = [ className: "RuntimeMetadata", swiftName: "runtimeMetadata" ), + SimpleDeclAttribute( + name: "_used", + className: "Used", + swiftName: "_used" + ), + DeclAttribute( + name: "_section", + className: "Section", + swiftName: "_section" + ), ] /// Schema for declaration modifiers: diff --git a/CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift b/CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift index 7263fdc8e03..159f2ba065f 100644 --- a/CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift +++ b/CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift @@ -72,6 +72,7 @@ public let KEYWORDS: [KeywordSpec] = [ KeywordSpec("_projectedValueProperty"), KeywordSpec("_read"), KeywordSpec("_RefCountedObject"), + KeywordSpec("_section"), KeywordSpec("_semantics"), KeywordSpec("_silgen_name"), KeywordSpec("_specialize"), diff --git a/Sources/SwiftParser/Attributes.swift b/Sources/SwiftParser/Attributes.swift index 5e92df0c54a..580aee1fa6e 100644 --- a/Sources/SwiftParser/Attributes.swift +++ b/Sources/SwiftParser/Attributes.swift @@ -46,6 +46,7 @@ extension Parser { case _originallyDefinedIn case _private case _projectedValueProperty + case _section case _semantics case _silgen_name case _specialize @@ -81,6 +82,7 @@ extension Parser { case TokenSpec(._originallyDefinedIn): self = ._originallyDefinedIn case TokenSpec(._private): self = ._private case TokenSpec(._projectedValueProperty): self = ._projectedValueProperty + case TokenSpec(._section): self = ._section case TokenSpec(._semantics): self = ._semantics case TokenSpec(._silgen_name): self = ._silgen_name case TokenSpec(._specialize): self = ._specialize @@ -120,6 +122,7 @@ extension Parser { case ._originallyDefinedIn: return .keyword(._originallyDefinedIn) case ._private: return .keyword(._private) case ._projectedValueProperty: return .keyword(._projectedValueProperty) + case ._section: return .keyword(._section) case ._semantics: return .keyword(._semantics) case ._silgen_name: return .keyword(._silgen_name) case ._specialize: return .keyword(._specialize) @@ -305,6 +308,10 @@ extension Parser { return parseAttribute(argumentMode: .required) { parser in return .exposeAttributeArguments(parser.parseExposeArguments()) } + case ._section: + return parseAttribute(argumentMode: .required) { parser in + return .string(parser.parseStringLiteral()) + } case ._originallyDefinedIn: return parseAttribute(argumentMode: .required) { parser in return .originallyDefinedInArguments(parser.parseOriginallyDefinedInArguments()) diff --git a/Sources/SwiftSyntax/generated/Keyword.swift b/Sources/SwiftSyntax/generated/Keyword.swift index c0b6d85f1a5..9286c26616f 100644 --- a/Sources/SwiftSyntax/generated/Keyword.swift +++ b/Sources/SwiftSyntax/generated/Keyword.swift @@ -48,6 +48,7 @@ public enum Keyword: UInt8, Hashable { case _projectedValueProperty case _read case _RefCountedObject + case _section case _semantics case _silgen_name case _specialize @@ -471,6 +472,8 @@ public enum Keyword: UInt8, Hashable { self = ._forward case "_private": self = ._private + case "_section": + self = ._section case "_Trivial": self = ._Trivial case "_version": @@ -791,6 +794,7 @@ public enum Keyword: UInt8, Hashable { "_projectedValueProperty", "_read", "_RefCountedObject", + "_section", "_semantics", "_silgen_name", "_specialize",