First example
It generates code that doesn't compile:
grammar Example
offOrOn = ("0" | "1")+
generates:
public struct Example: Codable {
public let offOrOn : OffOrOn
...
}
Second example
It generates the structure that won't be able to represent the parsed string:
grammar Example
off = "0"
on = "1"
mix = (off | on)+
result:
public struct Example: Codable {
// Mix
public enum Mix: Codable {
case on(on:[Swift.String])
case off(off:[Swift.String])
}
...
}
First example
It generates code that doesn't compile:
generates:
Second example
It generates the structure that won't be able to represent the parsed string:
result: