1
我在读sbt documentation on Commands,想知道^^^
和~>
是什么意思?`^^^`和`〜>`是什么意思?
我试图谷歌,但没有发现,这些字符是由谷歌躲过我猜......非常感谢
// Demonstration of a custom parser.
// The command changes the foreground or background terminal color
// according to the input.
lazy val change = Space ~> (reset | setColor)
lazy val reset = token("reset" ^^^ "\033[0m")
lazy val color = token(Space ~> ("blue" ^^^ "4" | "green" ^^^ "2"))
lazy val select = token("fg" ^^^ "3" | "bg" ^^^ "4")
lazy val setColor = (select ~ color) map { case (g, c) => "\033[" + g + c + "m" }
def changeColor = Command("color")(_ => change) { (state, ansicode) =>
print(ansicode)
state
}
完整的代码为例project/CommandExample.scala
在http://www.scala-sbt.org/0.13/docs/Commands.html
谢谢,正是我在找的:) – keypoint