Skip to content

Shebang triggers syntax error #523

@mwgkgk

Description

@mwgkgk

Code:

#!/usr/bin/env ocaml

(* ... *)

Error:

ocamlformat: ignoring "hello.ml" (syntax error)
File "hello.ml", line 1, characters 0-3:
Error: Syntax error

Judging by this StackOverflow post recommending preprocessing the shebang away with sed these things are not super welcome in OCaml community. Github search returns a number of examples, some of them including the top-level directives like #load which trigger the same syntax error. I'm too new to be sure if these examples fall under the TOS listed in the readme ("OCamlFormat requires source code that meets the following conditions...") . Preprocessing the thing away with sed would require to stitch it back on again :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions