Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Translate `show x y` into `;show x ;show y` . fixes #495

  • Loading branch information...
commit 364d49d4b4a2bf347df0642c62d3c66fd9ac8eee 1 parent 8d20a7e
Mark Harrah authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 main/Act.scala
13 main/Act.scala
View
@@ -226,10 +226,17 @@ object Act
{
val extracted = Project extract state
import extracted.{showKey, structure}
+ import Aggregation.evaluatingParser
showParser.flatMap { show =>
- aggregatedKeyParser(extracted) flatMap { kvs =>
- Aggregation.evaluatingParser(state, structure, show)( keyValues(structure)(kvs) )
- }
+ val akp = aggregatedKeyParser(extracted)
+ def evaluate(kvs: Seq[ScopedKey[T]] forSome { type T}): Parser[() => State] = evaluatingParser(state, structure, show)( keyValues(structure)(kvs) )
+ def reconstruct(arg: String): String = ShowCommand + " " + arg
+ if(show)
+ ( akp ~ (token(Space) ~> matched(akp)).* ) flatMap { case (kvs, tail) =>
+ evaluate(kvs) map { f => () => tail.map(reconstruct) ::: f() }
+ }
+ else
+ akp flatMap evaluate
}
}
def showParser = token( (ShowCommand ~ Space) ^^^ true) ?? false
Please sign in to comment.
Something went wrong with that request. Please try again.