Created
August 21, 2014 17:19
-
-
Save djspiewak/468fa881e94f9b50f0d5 to your computer and use it in GitHub Desktop.
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
def lookahead[A](delegate: Parser[A]): Parser[(A, LineStream)] = new TerminalParser { | |
def parse(in: LineStream): Result[(A, LineStream)] = delegate parse in match { | |
case Success(value, tail) => Success((value, in), tail) | |
case r => r | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment