@@ -209,6 +209,10 @@ extension Parser {
209
209
return parseAttribute ( hasRequiredArguments: true ) { parser in
210
210
return . exposeAttributeArguments( parser. parseExposeArguments ( ) )
211
211
}
212
+ case . _originallyDefinedIn:
213
+ return parseAttribute ( hasRequiredArguments: true ) { parser in
214
+ return . originallyDefinedInArguments( parser. parseOriginallyDefinedInArguments ( ) )
215
+ }
212
216
case . __objc_bridged, . __raw_doc_comment, . _alwaysEmitConformanceMetadata, . _alwaysEmitIntoClient, . _assemblyVision, . _borrowed, . _compilerInitialized, . _custom, . _disfavoredOverload, . _eagerMove, . _exported, . _fixed_layout, . _frozen, . _hasInitialValue, . _hasMissingDesignatedInitializers, . _hasStorage, . _implementationOnly, . _implicitSelfCapture, . _inheritActorContext, . _inheritsConvenienceInitializers, . _marker, . _moveOnly, . _noAllocation, . _noEagerMove, . _noImplicitCopy, . _noLocks, . _noMetadata, . _nonEphemeral, . _nonoverride, . _objc_non_lazy_realization, . _show_in_interface, . _specializeExtension, . _spiOnly, . _staticInitializeObjCMetadata, . _transparent, . _unsafeInheritExecutor, . _weakLinked, . atReasync, . atRethrows, . discardableResult, . dynamicCallable, . dynamicMemberLookup, . frozen, . GKInspectable, . globalActor, . IBAction, . IBDesignable, . IBInspectable, . IBOutlet, . IBSegueAction, . inlinable, . LLDBDebuggerFunction, . main, . noDerivative, . nonobjc, . NSApplicationMain, . NSCopying,
213
217
. NSManaged, . objcMembers, . preconcurrency, . propertyWrapper, . requires_stored_property_inits, . resultBuilder, . runtimeMetadata, . Sendable, . testable, . typeWrapper, . typeWrapperIgnored, . UIApplicationMain, . unsafe_no_objc_tagged_pointer, . usableFromInline, . warn_unqualified_access:
214
218
// No arguments
@@ -217,9 +221,6 @@ extension Parser {
217
221
// Virtual attributes that should not be parsed
218
222
break
219
223
// MARK: - Other
220
- case . _originallyDefinedIn:
221
- // @_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0)
222
- break
223
224
case . _unavailableFromAsync:
224
225
// @_unavailableFromAsync(message: "Use Task.runInline from a sync context to begin an async context.")
225
226
break
@@ -839,13 +840,13 @@ extension Parser {
839
840
mutating func parseBackDeployArguments( ) -> RawBackDeployAttributeSpecListSyntax {
840
841
let ( unexpectedBeforeLabel, label) = self . expectContextualKeyword ( " before " )
841
842
let ( unexpectedBeforeColon, colon) = self . expect ( . colon)
842
- var elements : [ RawBackDeployVersionArgumentSyntax ] = [ ]
843
+ var elements : [ RawAvailabilityVersionRestrictionListEntrySyntax ] = [ ]
843
844
var keepGoing : RawTokenSyntax ? = nil
844
845
repeat {
845
846
let versionRestriction = self . parsePlatformVersionConstraintSpec ( )
846
847
keepGoing = self . consume ( if: . comma)
847
848
elements. append (
848
- RawBackDeployVersionArgumentSyntax (
849
+ RawAvailabilityVersionRestrictionListEntrySyntax (
849
850
availabilityVersionRestriction: versionRestriction,
850
851
trailingComma: keepGoing,
851
852
arena: self . arena
@@ -857,7 +858,7 @@ extension Parser {
857
858
beforeLabel: label,
858
859
unexpectedBeforeColon,
859
860
colon: colon,
860
- versionList: RawBackDeployVersionListSyntax ( elements: elements, arena: self . arena) ,
861
+ versionList: RawAvailabilityVersionRestrictionListSyntax ( elements: elements, arena: self . arena) ,
861
862
arena: self . arena
862
863
)
863
864
}
@@ -895,6 +896,42 @@ extension Parser {
895
896
}
896
897
}
897
898
899
+ extension Parser {
900
+ mutating func parseOriginallyDefinedInArguments( ) -> RawOriginallyDefinedInArgumentsSyntax {
901
+ let ( unexpectedBeforeModuleLabel, moduleLabel) = self . expectContextualKeyword ( " module " )
902
+ let ( unexpectedBeforeColon, colon) = self . expect ( . colon)
903
+ let ( unexpectedBeforeModuleName, moduleName) = self . expect ( . stringLiteral)
904
+ let ( unexpectedBeforeComma, comma) = self . expect ( . comma)
905
+
906
+ var platforms : [ RawAvailabilityVersionRestrictionListEntrySyntax ] = [ ]
907
+ var keepGoing : RawTokenSyntax ?
908
+ repeat {
909
+ let restriction = self . parseAvailabilityMacro ( )
910
+ keepGoing = self . consume ( if: . comma)
911
+ platforms. append (
912
+ RawAvailabilityVersionRestrictionListEntrySyntax (
913
+ availabilityVersionRestriction: restriction,
914
+ trailingComma: keepGoing,
915
+ arena: self . arena
916
+ )
917
+ )
918
+ } while keepGoing != nil
919
+
920
+ return RawOriginallyDefinedInArgumentsSyntax (
921
+ unexpectedBeforeModuleLabel,
922
+ moduleLabel: moduleLabel,
923
+ unexpectedBeforeColon,
924
+ colon: colon,
925
+ unexpectedBeforeModuleName,
926
+ moduleName: moduleName,
927
+ unexpectedBeforeComma,
928
+ comma: comma,
929
+ platforms: RawAvailabilityVersionRestrictionListSyntax ( elements: platforms, arena: self . arena) ,
930
+ arena: self . arena
931
+ )
932
+ }
933
+ }
934
+
898
935
// MARK: Lookahead
899
936
900
937
extension Parser . Lookahead {
0 commit comments