Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDocumentation updates and related feedback #12
Comments
|
Hey, thanks so much for the feedback! I started working on updating the docs and I'll try to address all these points. Just wanted to update the issue, as I couldn't push it today yet. 1 - the name of the file is Thanks again for the feedback, I'll push a commit soon referencing this diff. |
I thought I had it working, but nope, it wasn't correct. tl;dr I was trying to identify nested closures that weakly captured |
|
Thanks for all the answers. |
|
Here's one case where we see the SyntaxError when handling double optionals: final class Foo {
func bar(string: String??) {
if case let string?? = string {}
}
} |
|
Here's another case: final class Foo {
func bar() {
switch "" {
case "foo":
return
default:
break
}
}
} |
|
Here's another case with multi-line strings: final class Foo {
func bar() {
"""
Shouldn't be able to update a pickup location if there is no
current ride, or the map isn't fully initialized
"""
}
} |
|
Another case with some weird characters for variable names: final class Foo {
func bar() {
let sinφ = sin(0)
}
} |
|
Another case if you add a newline between your function name and the arguments final class Foo {
func bar
(completion: @escaping () -> Void) {}
} |
|
I think that's most of the case we have, happy to provide more info if that would be useful! This was with neal from homebrew with |
|
Thanks for all the examples. Some of these issues are known: we have to add support for Swift 4 features (keypaths will also fail to parse) and there's no unicode support (OCaml doesn't like it). The issue with newlines is a bit more unfortunate indeed, but sadly Swift cares about newlines and (to the best of my knowledge) is not well documented where it's valid to have a newline or not, so it was implement based on trial and error (luckily I had a decent-sized codebase to test it). I'll get working on some of these errors, but let me know if you'd like to contribute :) |
Newlines should be allowed between a function's name and its parameter clause. Also allow newlines after attributes and add tests.
|
@keith all the parse errors you reported, except for unicode support, should be fixed on master. I still want to support unicode, but that's a slightly bigger task, so it might take a bit longer until I get to it. I'll try to publish a new version soon, but let me know if you try it out before. |
|
@tadeuzagallo Is there syntax to express the "current node"? I'm finding myself wanting something like that for scoped matchers. For example, using
The following two don't have the same meaning. One of Left and/or Right could be non-children descendants:
This guarantees individual parent/child relationship, but doesn't prevent the case where the Nodes are different instances.
|
|
@kastiglione Yeah, you're right, that's not supported but it does make a lot of sense. It should be easy to implement, I'll see if I can get this done soon. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

I tried NEAL today and in short time I had a "working" rule. I wanted to provide some feedback on the issues I hit
.rulesso I tried that, but it didn't work. At first I thought NEAL was crazy fast but it turns out it just wasn't running any rules.>and>>which I found info on through the source and commits. There's one example that uses them, and not many tests that use them.varandconditionwhich I noticed in a test, and eventually found more info on in #9.match()to work, and I wasn't able to debug my use of it since I didn't know what the (generated) string it was matching against would look like.property.accesssyntax, but it's not documented so I'm not clear what it's used for.SyntaxError}: satisfy.whereclauses with properties that are lists of nodes, or conversely, how properties mix with matchers..rulesfile, only a line and column number are shown. It would be nice to show the line and a^label just like how warnings/errors in source files are shown.