Closed j0sh closed 8 years ago
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 Ast_helper.with_default_loc
) and the opens have been trimmed a bit.
CC me
I've merged & adapted the OMake-based build system in my ppx branch.
I found the cause of the ... an expression was expected of type 'a Lwt/0.t
type error, it was the outer (>>=)
.
Now it's choking on this:
S.select db [%sql "SELECT @d{%d}"] 42 >|= aeq_list ~printer:(sprintf "%d") [42] >>= fun () ->
File "t_ppx_sqlexpr.ml", line 121, characters 22-25:
Error: The field Sqlexpr.sql_statement belongs to the record type
Sqlexpr.statement
but a field was expected belonging to the record type
S.expression = Sqlexpr.expression
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.