-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhauncement] Added 'for' loops #26
Conversation
withGeqBinOp Div Div y _ = y | ||
withGeqBinOp _ _ _ z = z | ||
withGeqUni :: Uni f a1 -> Uni f a2 -> b -> (a1 ~ a2 => b) -> b | ||
withGeqUni Bool Bool _ y = y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old order was less convenient.
, case knownUni @f @a of | ||
Bool -> neq0Expr <|> eqExpr | ||
Field -> empty | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now have a single expr1
and can share some code, which is convenient.
, EAppBinOp FLt l <$> (symbol "<" *> exprPoly) | ||
, EAppBinOp FGe l <$> (symbol ">=" *> exprPoly) | ||
, EAppBinOp FGt l <$> (symbol ">" *> exprPoly) | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a TODO above about optimizing comparisonExpr
. This fixes the TODO.
, " end;" | ||
, "end;" | ||
, "p" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example.
7f24f75
to
f1cc915
Compare
I'll merge right away, because I need this downstream, but please @kwxm review the PR anyway, I'll address your comments in a future PR. |
This adds the type of statements to the language (currently a statement is either a let-definition or an assertion) and
for
loops that get unrolled during parsing into lists of statements.I also refactored the parser a bit.