StrongerXi / soc

Compiler for a subset of OCaml
1 stars 0 forks source link

Infix ops #11

Closed StrongerXi closed 3 years ago

StrongerXi commented 3 years ago
let (-) x y = y - x
and (+) = 42
;;
(+) - 0 (* yields -42 *)

How cool is that. For permitted symbols for infix ops, their associativity and precedence, I just used OCaml's parser implementation as the standards.