Skip to content

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Aug 1, 2025

Also '#error', '#warning', and '#sourceLocation'.

Other call-like syntax (call expression, macro expansion, custom attributes, and some builtin attributes like @available) requires '(' on the same line as the callee name. For consistency, all built-in attributes and directives should also ignore '(' on next line.

@rintaro
Copy link
Member Author

rintaro commented Aug 1, 2025

swiftlang/swift-syntax#3132
@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Aug 1, 2025

swiftlang/swift-syntax#3132
@swift-ci Please Test Source Compatibility

@@ -2503,7 +2503,7 @@ static std::optional<Identifier> parseSingleAttrOptionImpl(
};
bool isDeclModifier = DeclAttribute::isDeclModifier(DK);

if (!P.Tok.is(tok::l_paren)) {
if (!P.Tok.isFollowingLParen()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this change but I've always disliked the name isFollowingLParen, to me it reads as "is token following an l-paren", when really it's "is token a following-l-paren". Maybe we should just call it isSameLineLParen?

@rintaro rintaro force-pushed the parse-attr-l-paren-newline branch from 44ecb58 to b271766 Compare August 4, 2025 15:39
@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please Test Source Compatibility

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please Test Source Compatibility

@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please smoke test Linux

@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please smoke test macOS

@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please Test Source Compatibility Release

2 similar comments
@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please Test Source Compatibility Release

@rintaro
Copy link
Member Author

rintaro commented Aug 4, 2025

swiftlang/swift-syntax#3132
@swift-ci Please Test Source Compatibility Release

@rintaro
Copy link
Member Author

rintaro commented Aug 20, 2025

swiftlang/swift-syntax#3132
@swift-ci Please smoke test

Also '#error', '#warning', and '#sourceLocation'.

Other call-like syntax (call expression, macro expansion, and custom
attribtues) requires '(' on the same line as the callee. For consistency,
built-in attributes and built-in directives should also ignore '(' on
next line.
@rintaro rintaro force-pushed the parse-attr-l-paren-newline branch from b271766 to a8fba10 Compare August 25, 2025 02:20
@rintaro
Copy link
Member Author

rintaro commented Aug 25, 2025

swiftlang/swift-syntax#3132
@swift-ci Please smoke test

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Aug 25, 2025

swiftlang/swift-syntax#3132
@swift-ci Please smoke test

@rintaro rintaro merged commit 358d6bd into swiftlang:main Aug 25, 2025
3 checks passed
@rintaro rintaro deleted the parse-attr-l-paren-newline branch August 25, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants