Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6909] libSyntax doesn't know about operator precedence #49458

Closed
dabrahams opened this issue Feb 2, 2018 · 1 comment
Closed

[SR-6909] libSyntax doesn't know about operator precedence #49458

dabrahams opened this issue Feb 2, 2018 · 1 comment
Labels
compiler The Swift compiler in itself declarations Feature: declarations expressions Feature: expressions feature A feature request or implementation † libswiftSyntax † Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax operators Feature: operators precedence groups Feature → operators: precedence groups stale Resolution: No longer relevant, stale

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-6909
Radar None
Original Reporter @dabrahams
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, Syntax
Assignee None
Priority Medium

md5: 2493838608afee26863c2c17f96fb301

Issue Description:

If you want to line-break an expression, you want to break it near lower-precedence operators, so you end up with

longThing1 * longThing2
+ longThing3 * longThing4

rather than

longThing1 * longThing2 + longThing3
   * longThing4

or worse:

longThing1
    * longThing2 + longThing3
    * longThing4

But libSyntax is flattening all of that into SequenceExprSyntax so that information is lost. I realize that file-at-a-time processing can't always do this reliably, but... it could try. And it could know about the precedences in the standard library.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added compiler The Swift compiler in itself operators Feature: operators expressions Feature: expressions feature A feature request or implementation precedence groups Feature → operators: precedence groups declarations Feature: declarations and removed bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. labels Apr 5, 2023
@AnthonyLatsis
Copy link
Collaborator

libSyntax was removed in #62145 and succeeded by swift-syntax.

@AnthonyLatsis AnthonyLatsis closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
@AnthonyLatsis AnthonyLatsis added the stale Resolution: No longer relevant, stale label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself declarations Feature: declarations expressions Feature: expressions feature A feature request or implementation † libswiftSyntax † Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax operators Feature: operators precedence groups Feature → operators: precedence groups stale Resolution: No longer relevant, stale
Projects
None yet
Development

No branches or pull requests

2 participants