Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006463OCamlOCaml generalpublic2014-06-19 16:472014-06-20 17:17
Reporterwhitequark 
Assigned Tofrisch 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.02.0+beta1 / +rc1 
Target VersionFixed in Version4.02.0+dev 
Summary0006463: No sane way to report invalid arguments from a ppx preprocessor
DescriptionCurrently I have code that looks like this:

    let lwt_mapper args =
      args |> List.iter (fun arg ->
        match arg with
        | "-no-debug" -> debug := false
        | _ -> raise (Location.Error (Location.errorf "Unknown lwt.ppx argument: %s\n\n" arg));
      { default_mapper with
        expr = fun mapper expr ->
        match expr with
        | [%expr [%lwt let _ = [%e? exp]]] ->
          lwt_expression mapper exp

        | x -> default_mapper.expr mapper x;
      }

However, such error would presently be ignored by Ast_mapper.run_mapper.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0011758)
frisch (developer)
2014-06-19 17:11

Good point. Commit 14989 on 4.02 should fix that. Can you confirm?
(0011759)
whitequark (developer)
2014-06-19 17:41

Sorry, I can't confirm at the moment--due to a bug in opam, reinstalling a switch requires a lot of manual work. But it seems like it would fix the bug.

I'll comment later.
(0011767)
whitequark (developer)
2014-06-20 17:15

Confirmed as working.

    $ ocaml -ppx 'ppx_lwt -foo'
            OCaml version 4.02.0+dev10-2014-05-20
    # 1;;
    File "_none_", line 1:
    Unknown lwt.ppx argument: -foo
    #
(0011768)
frisch (developer)
2014-06-20 17:17

Thanks for the feedback!

- Issue History
Date Modified Username Field Change
2014-06-19 16:47 whitequark New Issue
2014-06-19 17:11 frisch Note Added: 0011758
2014-06-19 17:41 whitequark Note Added: 0011759
2014-06-20 17:15 whitequark Note Added: 0011767
2014-06-20 17:17 frisch Note Added: 0011768
2014-06-20 17:17 frisch Status new => resolved
2014-06-20 17:17 frisch Fixed in Version => 4.02.0+dev
2014-06-20 17:17 frisch Resolution open => fixed
2014-06-20 17:17 frisch Assigned To => frisch


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker