Advertisement
Guest User

Untitled

a guest
Mar 1st, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.50 KB | None | 0 0
  1. private def withModifier(req: Requirement): Parser[Any] = {
  2.     if(req.isInstanceOf[DegreeRequirement]) {
  3.     err("_with_ modifiers may not be applied to Degree requirements")
  4.     } |
  5.     (("with"~>determiner)^^{
  6.     //In here I would like to check if req isInstanceOf[RelationshipRequirement]
  7.     //If it is, I would then like to do case d => req.asInstanceOf[RelationshipRequirement].related = d.provtype
  8.     }) |
  9.     ("with"~>"probability"~>numericLit^^{
  10.       case p => req.probability = p.toDouble
  11.     })
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement