This commit is contained in:
Smaug123
2024-01-22 22:03:45 +00:00
parent 45287e250a
commit 04edaf65ed
3 changed files with 74 additions and 24 deletions

View File

@@ -28,8 +28,7 @@ module Example =
| TokenType.RightBracket -> None
let parser =
Parser.empty _.Type
|> Parser.defineAtoms atom
Parser.make (fun token -> token.Type) atom
|> Parser.withUnaryPostfix TokenType.Factorial (7, ()) Expr.factorial
|> Parser.withUnaryPrefix TokenType.Plus ((), 5) id
|> Parser.withUnaryPrefix TokenType.Minus ((), 5) Expr.unaryMinus