Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Error for wrong type placeholders #44

Merged
merged 3 commits into from
May 28, 2017

Conversation

djbe
Copy link
Member

@djbe djbe commented May 26, 2017

Throws an error if placeholders in a format string (for the same position) have different types, for example:

"Text: %1$@; %1$ld."

Fixes SwiftGen/SwiftGen#309.

@djbe djbe added this to the 2.0.0 milestone May 26, 2017
@djbe djbe changed the title Feature/error for wrong type placeholders Error for wrong type placeholders May 26, 2017
do {
_ = try StringsFileParser.PlaceholderType.placeholders(fromFormat: "Text: %1$@; %1$ld.")
XCTFail("Code did parse string successfully while it was expected to fail for bad syntax")
} catch StringsFileParserError.invalidPlaceholder {

Choose a reason for hiding this comment

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

Beautiful

@AliSoftware AliSoftware force-pushed the feature/error-for-wrong-type-placeholders branch from d1d9d1b to d7578f2 Compare May 27, 2017 18:39
@AliSoftware
Copy link
Contributor

AliSoftware commented May 27, 2017

@djbe LGTM, Just rebased, ready to merge… but I'll let you review one last time to ensure I haven't mixed things up during the conflict resolution.

Note that you'll probably want to merge this first, before #41, to reduce conflicts between those two PRs

@djbe djbe merged commit 4ce4f99 into master May 28, 2017
@djbe djbe deleted the feature/error-for-wrong-type-placeholders branch May 28, 2017 10:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants