Skip to content

Added clr files parser#81

Merged
AliSoftware merged 3 commits intoSwiftGen:masterfrom
ilyapuchka:clr
Jan 8, 2016
Merged

Added clr files parser#81
AliSoftware merged 3 commits intoSwiftGen:masterfrom
ilyapuchka:clr

Conversation

@ilyapuchka
Copy link
Copy Markdown
Contributor

This PR adds support for clr files using the same templates used for text files.

Comment thread GenumKit/Parsers/ColorsFileParser.swift Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the removal of spaces necessary here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In palettes who knows what users can have. At least we provide some sanity checks. Of course if user have Color#1 like names it will not work anyway.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But you don't need that. It's not the work of the parser to sanitize the color name. It's the work of the template filters, like here.

That's because people could want to customize their template and use the real name (with spaces and all) for purposes other than just use them as the swift identifier, but to use them to generate comments for each color, or to associate a color name as a String or implement a nice CustomStringConvertible or whatnot. But if they use it as a swift identifier, that's their responsibility to call the swiftIdentifier Stencil filter on the name in their template in the appropriate place(s).

@AliSoftware
Copy link
Copy Markdown
Collaborator

Aside from the 1-2 comments I did on your last commit, looks good to merge, nice work 👍

AliSoftware added a commit that referenced this pull request Jan 8, 2016
Added `.clr` (color palettes) parser
@AliSoftware AliSoftware merged commit 3e531e3 into SwiftGen:master Jan 8, 2016
@ilyapuchka ilyapuchka deleted the clr branch September 7, 2018 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants