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-10469] Unknown syntax for interpolated string literal #52869

Closed
rintaro mannequin opened this issue Apr 12, 2019 · 4 comments
Closed

[SR-10469] Unknown syntax for interpolated string literal #52869

rintaro mannequin opened this issue Apr 12, 2019 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself interpolated strings Feature → expressions → literals → string literals: interpolated strings † libswiftSyntax † Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax literals Feature → expressions: Literals such as an integer or string literal unexpected error Bug: Unexpected error

Comments

@rintaro
Copy link
Mannequin

rintaro mannequin commented Apr 12, 2019

Previous ID SR-10469
Radar rdar://problem/49855746
Original Reporter @rintaro
Type Bug
Status Resolved
Resolution Done
Environment

swift master (77a79f2)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Syntax
Assignee kitasuke (JIRA)
Priority Medium

md5: 7bc00c2f480ca5381d03eef3740968c6

relates to:

  • SR-10241 A way to get raw string without quotes from StringLiteralExprSyntax

Issue Description:

"\(1, foo: 2)"
$ swift-syntax-test -parse-gen -input-source-filename test.swift
test.swift:1:1: error: unknown expression syntax exists in the source
"\(1, foo: 2)"
^
"\(1, foo: 2)"
@rintaro
Copy link
Mannequin Author

rintaro mannequin commented Apr 12, 2019

# expression segment in a string interpolation expression.
Node('ExpressionSegment', kind='Syntax',
traits=['Parenthesized'],
children=[
Child('Backslash', kind='BackslashToken'),
Child('LeftParen', kind='LeftParenToken',
classification='StringInterpolationAnchor',
force_classification=True),
Child('Expression', kind='Expr'),
Child('RightParen', kind='StringInterpolationAnchorToken'),
]),

    # expression segment in a string interpolation expression.
    Node('ExpressionSegment', kind='Syntax',
         traits=['Parenthesized'],
         children=[
             Child('Backslash', kind='BackslashToken'),
             Child('LeftParen', kind='LeftParenToken',
                   classification='StringInterpolationAnchor',
                   force_classification=True),
             Child('Expression', kind='Expr'),
             Child('RightParen', kind='StringInterpolationAnchorToken'),
         ]),

The expression part should be FunctionCallArgumentList as per SE-0228

@rintaro
Copy link
Mannequin Author

rintaro mannequin commented Apr 12, 2019

kitasuke (JIRA User) Are you interested in fixing this too?

@swift-ci
Copy link
Collaborator

Comment by Yusuke Kita (JIRA)

Yes, let me look into this.

@rintaro
Copy link
Mannequin Author

rintaro mannequin commented Jun 11, 2019

master: #24280 -> #24398
swift-5.1-branch: #24846

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added interpolated strings Feature → expressions → literals → string literals: interpolated strings literals Feature → expressions: Literals such as an integer or string literal unexpected error Bug: Unexpected error labels Apr 5, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself interpolated strings Feature → expressions → literals → string literals: interpolated strings † libswiftSyntax † Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax literals Feature → expressions: Literals such as an integer or string literal unexpected error Bug: Unexpected error
Projects
None yet
Development

No branches or pull requests

2 participants