Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IF : Bool -> Expr -> Expr -> Expr;
- IF True code end {
- return ({ code } end);
- }
- IF False _ end {
- return (end);
- }
- IF False _ (ELSE code) {
- return (code);
- }
- ELSE : Expr -> Expr
- ELSE _ {
- return ();
- }
- WHILE condition:Bool code:Expr {
- return ({
- label $loop
- IF b {
- { code }
- goto $loop;
- }
- label $end;
- });
- BREAK {
- goto $end;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement