Skip to content

Instrumentation and preprocessing #9

Description

@epatrizio

Hello, It seems that the instrumentation is launched before the preprocessor, generating errors in some cases.
Here is a minimalistic example with sedlex preprocessing :

$ git clone https://github.com/jmid/mutaml.git
$ cd mutaml
$ opam install .
$ cd ..
$ git clone https://github.com/epatrizio/mutaml_exp.git
$ cd mutaml_exp
$ dune runtest --instrument-with mutaml
File "lib/dune", line 4, characters 2-18:
4 |   (pps sedlex.ppx))
      ^^^^^^^^^^^^^^^^
Running mutaml instrumentation on "lib/lib.ml"
Randomness seed: 374585493   Mutation rate: 50   GADTs enabled: true
Created 4 mutations of lib/lib.ml
Writing mutation info to lib/lib.muts
File "lib/lib.ml", line 12, characters 4-24:
12 |   | "hello" -> token buf
         ^^^^^^^^^^^^^^^^^^^^
Error: Sedlex: 'when' guards are not supported

What happens is that mutaml inserts some when guards on a branch from a match%sedlex construct. Sedlex then complains because it can not handle such guards.
I don't know if it's possible to tell dune to instrument the code only after preprocessing ? Otherwise, should the instrumentation tool (mutaml) be careful and not modify code that contains preprocessing annotations ?
Thanks a lot!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions