binary-parser
binary-parser copied to clipboard
choices on string
how can this work ?
This is the way I worked around the numbers only choice limitation:
choice({
tag : function() { return ["ABC", "MNO", "XYZ"].indexOf(this.someVar)+1 || -1; },
choices :
{
1 : abcParser,
2 : mnoParser,
3 : xyzParser
},
defaultChoice : unknownParser
});