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-12605] #sourceLocation doesn't allow underscores in line numbers #55049

Open
beccadax opened this issue Apr 15, 2020 · 2 comments
Open

[SR-12605] #sourceLocation doesn't allow underscores in line numbers #55049

beccadax opened this issue Apr 15, 2020 · 2 comments

Comments

@beccadax
Copy link
Contributor

@beccadax beccadax commented Apr 15, 2020

Previous ID SR-12605
Radar rdar://problem/62202395
Original Reporter @beccadax
Type Bug
Environment

Near-master, 15 April 2019

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Parser, StarterBug
Assignee matthewspear (JIRA)
Priority Medium

md5: 41076a6957823a7ff8a7fce6be55225d

Issue Description:

  1> #sourceLocation(file: "a.swift", line: 1_000)
error: /var/folders/mw/1rhv6fn96gb8swwkt8zycwph0000gn/T/repl1-101710..swift:2:40: error: expected starting line number for #sourceLocation directive
#sourceLocation(file: "a.swift", line: 1_000)
                                       ^
  1> #sourceLocation(file: "a.swift", line: 1000)
  2> 1_000
$R0: Int = 1000
  3>  

Underscore separators in #sourceLocation directives probably ought to be supported.

@beccadax
Copy link
Contributor Author

@beccadax beccadax commented Apr 15, 2020

It looks like this should be relatively easy to fix—do something similar to how Parser::parseExprPrimary() handles underscores in integer literals. It may make sense to also look at other syntaxes that parse tok::integer_literal and make sure they support underscores if appropriate.

@beccadax
Copy link
Contributor Author

@beccadax beccadax commented Apr 17, 2020

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant