Skip to content

#use directive generates unparseable code #2

@craigfe

Description

@craigfe

The README contains a section on importing generator code from other files. This appears to be broken in the current version of cinaps (or, at least, I cannot get it to work). Adding the following to the test file:

(*$ #use "imported.cinaps";;
    let () = List.iter to_print ~f:printf
*)
(*$*)

produces the output:

❭ dune runtest
File "test_staged.ml", line 16, characters 4-5:
Error: Syntax error: 'end' expected
File "test/test_staged_gen.ml", line 34, characters 28-34:
34 |   (fun () -> let module M = struct
                                 ^^^^^^
  This 'struct' might be unmatched

This failure is contained in this branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions