Open KCreate opened 7 years ago
Passes could return some kind of status code or maybe throw exceptions (do we want to use exceptions?).
Looks good! This exists already in master. Exceptions are heavily used in OCaml.
(but mutability is not much used, so we'd probably fold the passes over the AST instead)
Worth also checking out testast.ml in the project root and its use of polymorphic variants:
I'd like to discuss how we'll build the mechanism that allows for arbitrary AST passes. The passes would modify the AST in place, since we don't need any old versions of the AST.
I was thinking of something like this (pseudo-code):