yanagiba / swift-ast

A Swift AST parser and visitor that is written in Swift.
Apache License 2.0
354 stars 40 forks source link

Get's confused by a switch statement which switches on CGPoints #91

Open rudro opened 5 years ago

rudro commented 5 years ago

Issue Summary

See the sample code, it's complete and can be run with a simple swift foo.swift to see the output. Note that the case statement confuses the parser.

Environment

Reproduction Steps

[Detailed steps to reproduce the issue.]

Sample code ``` import Foundation func foo(_ anchorPoint: CGPoint) { switch anchorPoint { // Top Left Corner case CGPoint(x: 1, y: 1): print("top left") default: print("other") } } foo(CGPoint(x: 1, y: 1)) ``` Command to run `swift-ast` with the code above: `swift-ast /Users/rudro/Downloads/foo.swift`

Expected Result

What do you expect to happen as a result of the reproduction steps?

Actual Behavior

What currently happens as a result of the reproduction steps?

/Users/rudro/Downloads/foo.swift:6:17 fatal: expectedCaseColon

Even Better

Is your project open sourced? If yes, can you point us to your repository? If not, is it possible to make a small project that fails the Travis CI? If not, can you create a gist with your sample code for us?

ryuichi-assistant commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.