roddyyaga / ppx_rapper

Syntax extension for writing SQL in OCaml
Other
139 stars 18 forks source link

Update codegen.ml #31

Closed marrious11 closed 1 year ago

marrious11 commented 1 year ago

Hi sir @panglesd here are some proposed changes still commented. Awaits review/suggestions before I could make a full modification to issue #29. Signed-off-by: Mario 66856309+marrious11@users.noreply.github.com

panglesd commented 1 year ago

Good efforts, and thanks for the PR! Unfortunately, I don't think the proposed modification really go toward a resolution of #29.

There is no need to replace match with function or use |> more often. What we want is to avoid raising (which is done here via the raise_errorf function). Instead, the errors should be collected, embedded at the right point in the AST, so that the execution can continue seamlessly.