Created
April 7, 2012 18:30
-
-
Save etluchs/2331186 to your computer and use it in GitHub Desktop.
simple interactive test for completing parser
This file contains 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
object CompletingParserTestApp extends TestParser with App { | |
println( "Type something and hit enter" ); | |
var input = "" | |
do { | |
input = readLine(); | |
parseAll( propertyPath, input ) match { | |
case s : Success[Any] => println ( "valid, parsed as "+ s.get) | |
case MissingCompletionOrFailure( completions, msg, in) | |
=> if ( completions.isEmpty ) | |
println( msg ) | |
else { | |
println( "possible completions: "); | |
for ( c <- completions ) println( input + c ) | |
} | |
} | |
} | |
while ( input != "" ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment