Created
February 16, 2010 00:07
-
-
Save micahrj/305126 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
term = try prefix <|> try paren <|> try name <|> try number <|> try str <?> "term" | |
prefix = do o <- prefixOper | |
t <- term | |
return $ Unary o t | |
prefixOper = token $ many1 $ oneOf $ nub $ concat prefixes | |
prefixes :: [String] | |
prefixes = [ "!" | |
, "-" | |
, "~" | |
, "not" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment