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

Closed
beccadax opened this issue Apr 15, 2020 · 2 comments · Fixed by #60795
Closed

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

beccadax opened this issue Apr 15, 2020 · 2 comments · Fixed by #60795
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers parser Area → compiler: The legacy C++ parser

Comments

@beccadax
Copy link
Contributor

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

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

@swift-ci create

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 good first issue Good for newcomers parser Area → compiler: The legacy C++ parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant