Replies: 1 comment 3 replies
-
Hi @ytyubox, good catch! Rather than making the initializer public, what if we made the parser work with all If you have the time you want to open a PR to do that? If not we can take care of it. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I would like to have my enum be a Parse. I have learned that we can use
RawValue
andCaseIterable
on the enum type to gain the Parse for free.For some reason, I would like to have my Parser adopt UInt8 enum, But I found that it is not achievable.
IMO, I have simple way for me is to extend
CaseIterable && RawRepresentable && UInt8
, likeCaseIterableRawRepresentable.swift
in a3d52c6swift-parsing/Sources/Parsing/ParserPrinters/CaseIterableRawRepresentable.swift
Lines 1 to 16 in a3d52c6
Then, I found that
Parsers.CaseIterableRawRepresentableParser
is public, but itsinit
isinternal
😞Therefore, I would like to propose making
Parsers.CaseIterableRawRepresentableParser.init
public!The patch is quite simple as follows.
Beta Was this translation helpful? Give feedback.
All reactions