-
Notifications
You must be signed in to change notification settings - Fork 197
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
Allow Semicolons in Swift Code #45
Comments
Whoa! The semicolons in Swift are the problem?! Can SwiftKotlin be modified to understand semicolons in Swift code? |
Semicolons are indeed the problem. I am working on a version that will indicate the issue when parsing wrong swift. By the way, SwiftKotlin is not always producing correct kotlin, it is still not complete, so if you use it as a learning tool have that in mind. |
That will be a great help if the SwiftKotlin app indicates to the user any issues it encounters when parsing Swift. Why are semicolons a problem? They are legal swift code. I have tens of thousands of lines of Swift with semicolons. Surely some other people who want to use SwiftKotlin will have some semicolons also. Must we remove all the semicolons? I hope not! |
SwiftKotlin uses a third party library for parsing and AST processing of the Swift files. That tool is not accepting it. I am not sure of the reason but semicolons are never used in Swift (albeit legal as you pointed out) I will handle this with the author. |
I changed the title of this issue to reflect the actual problem. I hope that the Swift parsing library author is open to the idea of allowing semicolons. I will keep my fingers crossed. Is there a Github issue you can link where you are asking the Swift parsing library author so I can follow along? Thanks. |
I see this issue... |
It seems that only one of the semicolons in my example is causing trouble. The following can be translated by SwiftKotlin app.
|
I hope the latest upstream changes on swift-ast will have this fixed. @petermichaux @angelolloqui if you can verify, please let me know if it works. |
Hi @ryuichis ! thanks for the quick support. I have tried the latest version and I can confirm that the code posted above works OK with the new version. Thanks! |
I have just added a small feedback label with a description of the compilation issue in the Mac app (fb8798b) |
I'm brand new to Kotlin. I'm actually hoping to learn quite a lot about Kotlin by looking at translations created by SwiftKotlin. I put the following very basic swift class definition into SwiftKotlin 0.1.0 and nothing happened. No output. No error messages. It seems like this swift code cannot be translated.
What to do?
The text was updated successfully, but these errors were encountered: