Skip to content

Instantly share code, notes, and snippets.

@machisuji
Created December 12, 2011 23:37
Show Gist options
  • Select an option

  • Save machisuji/1469672 to your computer and use it in GitHub Desktop.

Select an option

Save machisuji/1469672 to your computer and use it in GitHub Desktop.
[33.37] failure: identifier expected
any defined by operation parameters;
^
any defined by operation;
lexical.delimiters ++= List("{", "}", ";", "=", "<", ">")
lexical.reserved += ("int", "string", "binary", "any", "defined", "by", "struct",
"optional", "sequence", "union", "case", "typedef", "message", "protocol", "ID")
def identifier = guard(ident) ~>
regex("\\w+", error = "Identifier expected but ':token' found.") ^^ (Identifier)
def `type`: Parser[Type] = (
"any" ~ "defined" ~ "by" ~> identifier ~ identifier ^^ (AnyDefinedBy)
| identifier
| primitiveType
)
def identifier = guard(ident) ~>
regex("\\w+", error = "Identifier expected but ':token' found.") ^^ (Identifier)
def `type`: Parser[Type] = (
"any" ~ "defined" ~ "by" ~> identifier ^^ (AnyDefinedBy)
| identifier
| primitiveType
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment