Skip to content

Instantly share code, notes, and snippets.

@gakuzzzz
Created November 16, 2011 09:06
Show Gist options
  • Save gakuzzzz/1369641 to your computer and use it in GitHub Desktop.
Save gakuzzzz/1369641 to your computer and use it in GitHub Desktop.
//funcLiteral ::= "{" [[ident {"," ident}] "=>"] lines "}"
def funcLiteral: Parser[AST] = "{"~>opt(repsep(ident, ",")<~"=>")~lines<~"}"^^{
case Some(param)~x => Func(param.map(_.name), x)
case _~x => x
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment