Generate initializer in case multiple variables defined in a line.#21
Open
tiennth wants to merge 1 commit intoBouke:masterfrom
Open
Generate initializer in case multiple variables defined in a line.#21tiennth wants to merge 1 commit intoBouke:masterfrom
tiennth wants to merge 1 commit intoBouke:masterfrom
Conversation
Bouke
requested changes
Mar 2, 2019
Owner
Bouke
left a comment
There was a problem hiding this comment.
Thanks for reaching out and your contribution. Before merging this in, I would like to have a unit test that verifies the correctness of this change.
|
|
||
| // In case multiple variables defined in a line. | ||
| let variableNames = variableName.components(separatedBy: ",") | ||
| for vname in variableNames { |
Owner
There was a problem hiding this comment.
Variable names should be clearer. I.e. change the variable names around so the inner loop variable can be named variableName.
Owner
There was a problem hiding this comment.
You could also move this to the scanner part and use scanUpTo(characterSet:) to directly scan the variables into an array. That way there's no need to separate and trim them afterwards.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support this case:
let keywords, selectedCategory: String