-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: ppx #6
WIP: ppx #6
Conversation
let mklid s = {txt=Lident s; loc} in | ||
let mkident s = Exp.ident (mklid s) in | ||
let mkapply fn args = Exp.apply (mkident fn) args in | ||
let mkpident txt = Pat.var {txt; loc} in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure half of those are in Ast_convenience
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, didn't know about the Ast_convenience
module. Thanks!
The locations are not added for most of the generated parsetree. You should try to create ill-typed expressions and see where the error message points. (Also, I have bad opinions about starting a module with 6 open, some of them largely optional, but I'm not the maintainer.) |
Locations should be fixed now (via |
CC me |
I've merged & adapted the OMake-based build system in my ppx branch. I found the cause of the Now it's choking on this:
|
|
||
(* logic to extract inputs and outputs *) | ||
let inrgx = Re_pcre.regexp {|%([dlLfsSba])(\?)?|} in | ||
let outrgx = Re_pcre.regexp {|@([dlLfsSba])(\?)?\{((\w|\.)+)\}|} in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (L50) seems to be the culprit of ppx_sqlexpr choking on the likes of [%sql "SELECT @d{%d}"]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Fixed this and all the other remaining issues, sent another PR that goes into your ppx branch: #10
Also added some tests for the format-string parser, although the file is not in oasis yet.
The main test suite
t_sqlexpr_sqlite.ml
has also been converted to ppx, however it doesn't currently compile due to this strange type error:As far as I can tell, this is due to the wizardry in the
Test
module that redefines lwt and sqlexpr. Not sure how to fix this.Note that because lwt is redefined, we need to disable lwt debug due to lwt's syntax extensions calling some lwt-specific functions (backtrace_catch and friends), which don't exist in the redefined signature.