-
Notifications
You must be signed in to change notification settings - Fork 0
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
Errors with valid syntax #28
Comments
Thanks for the pointers! This project is a little quiet at the moment, I'll be able to commit time for it in about 4-6 weeks. |
No rush 🙂. Keep up the good work. |
First of all, amazing work! Especially when working in a Kotlin Multipaltform application, having some Swift support is great! I came across some syntax that was not supported, so just dropping it here for reference: let task = Task { @MainActor in
^
// ...
} where the error message says: '#', '#if', '#keypath', '&', '(', '.', ';', <, , , , , , , , , , , , , Any, Self, '', _, await, defer, do, self, super, try, '{' or '}' expected, got '{' If I remove the |
@kuglee I've fixed all your reported problems for the next update. @eirikvaa Could you provide a working example for the problem, please? If that's a closure expression, then the official Swift grammar doesn't support this, "Grammar of a closure expression" of https://docs.swift.org/swift-book/documentation/the-swift-programming-language/summaryofthegrammar#Declarations |
I can look at it next week, but the project I linked is a good example. |
@jansorg By looking at the Swift grammar, I think we can get to the syntax with the following rules and substitutions:
And then we are pretty much at func foo() {
Task { @MainActor in
print("I'm running on the main actor")
}
} |
Thanks for developing this.
I've tried it with one of my projects: SwiftFormatter. Unfortunately I've got some phantom errors reported in the following files (I'm using Xcode Version 15.2 (15C500b)):
',', ';', <extension member>, '=', '?', '{' or '}' expected, got '.'
'#if', ';', <infix expression>, <statement>, IDENTIFIER or KEYWORD_CONTEXT_SENSITIVE expected, got '}'
',', ':', <struct member>, '=' or '}' expected, got ':'
')', ',', '.', '...', <, '=' or '?' expected, got ','
')', ',', '...', '=', '?' or async expected, got '.'
'!', '#if', '(', '.', ';', <infix expression>, <statement>, '?' or '{' expected, got ')'
IDENTIFIER or KEYWORD_CONTEXT_SENSITIVE expected, got 'Self'
',', '.', ':', < or where expected, got '='
',', '.', ':', < or where expected, got '='
')' expected, got '@'
The text was updated successfully, but these errors were encountered: