Repository navigation
Enforce naming conventions for constants - #34
Conversation
There was a problem hiding this comment.
What made you refactor the comparator and assignment operators? To improve readability?
There was a problem hiding this comment.
Nope, it was to fix a bug in the grammar. I can discuss this in person if you want, too long of an explanation.
|
👍 |
There was a problem hiding this comment.
There seems to be a typo in the original ANTLR version of the Swift grammar compared to the Apple-provided grammar which indicates that external params are optional while local params are required:
parameter → inout? let? #? external-parameter-name? local-parameter-name type-annotation default-argument-clause?
parameter → inout? var #? external-parameter-name? local-parameter-name type-annotation default-argument-clause?
Shouldn't parameterName be made optional to match the Apple grammar and localParameterName be made required?
Also, it seems to make sense that typeAnnotation should be made optional. For closures, is this a bug in Apple's provided grammar?
There was a problem hiding this comment.
Ah true, this wouldn't really cause a bug though (in terms of parsing). But I guess in order to keep things consistent and if we eventually need to implement a check for external parameters in particular, I'll change this.
And yes, it was a bug in Apple's grammar.
|
👍 |
Enforce naming conventions for constants
Fixes #12.