Advertisement
Guest User

Untitled

a guest
Nov 9th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.47 KB | None | 0 0
  1. %nonassoc IF
  2. %nonassoc ELSE
  3.  
  4. %%
  5.  
  6. ifelse:
  7.     | IF cond = expr left = statement
  8.     { STMT_If { loc = mkLocation $startpos
  9.               ; cond = cond
  10.               ; then_branch = left
  11.               ; else_branch = None
  12.               }}
  13.  
  14.     | IF cond = expr left = statement ELSE right = statement
  15.     { STMT_If { loc = mkLocation $startpos
  16.               ; cond = cond
  17.               ; then_branch = left
  18.               ; else_branch = Some right
  19.               }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement