Skip to content
New issue

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

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

Already on GitHub? # to your account

operator_usage_whitespace incorrectly matches decimal literals in exponent format #1153

Closed
72A12F4E opened this issue Jan 10, 2017 · 1 comment
Labels
bug Unexpected and reproducible misbehavior.

Comments

@72A12F4E
Copy link

72A12F4E commented Jan 10, 2017

The following code causes an operator_usage_whitespace violation, and I do not think it should.

private var doubleValue = -9e-11
@jpsim
Copy link
Collaborator

jpsim commented Jan 10, 2017

You're right, it shouldn't... Thankfully, this should be pretty easy to fix, as we have this information from the syntax map:

$ sourcekitten syntax --text "let a = -9e-11"
[
  {
    "type" : "source.lang.swift.syntaxtype.keyword",
    "offset" : 0,
    "length" : 3
  },
  {
    "type" : "source.lang.swift.syntaxtype.identifier",
    "offset" : 4,
    "length" : 1
  },
  {
    "type" : "source.lang.swift.syntaxtype.number",
    "offset" : 8,
    "length" : 6
  }
]

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

2 participants