Last active
December 31, 2015 13:29
-
-
Save takeshik/7993484 to your computer and use it in GitHub Desktop.
Parseq new message system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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