Skip to content

Instantly share code, notes, and snippets.

@takeshik
Last active December 31, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takeshik/7993484 to your computer and use it in GitHub Desktop.
Save takeshik/7993484 to your computer and use it in GitHub Desktop.
Parseq new message system
var reply = Chars.Digit()
.Or(Chars.Any().Message("not a digit"))
.Many()
.Select(cs => new string(cs.ToArray()))
("12a3b".AsStream());
reply.Status.Dump(); // Success
reply.Left.Value.Value.Dump(); // "12a3b"
reply.Messages.Dump();
// [ not a digit (1:5,1:5),
// not a digit (1:3,1:3),
// ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment