Create a gist now

Instantly share code, notes, and snippets.

simple interactive test for completing parser
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