Skip to content

Instantly share code, notes, and snippets.

@PatrickKalkman
Created February 1, 2019 13:18
Show Gist options
  • Save PatrickKalkman/63133be9cba2782067430b9708465e4e to your computer and use it in GitHub Desktop.
Save PatrickKalkman/63133be9cba2782067430b9708465e4e to your computer and use it in GitHub Desktop.
Combining parsers to parse Tag attributes
public static readonly Parser<PlaylistTagAttribute> TagAttributeParser =
from attribute in AttributeWithQuotesParser
.Or(AttributeWithoutQuotesParser)
.Or(AttributeWithSingleValueParser)
select attribute;
public static readonly Parser<List<PlaylistTagAttribute>> MultipleTagAttributesParser =
from attributes in TagAttributeParser.Many()
select new List<PlaylistTagAttribute>(attributes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment