public
Created

simple interactive test for completing parser

  • Download Gist
App.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
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 != "" )
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.