Skip to content

The Ocaml printer crashes if the indent level becomes negative #439

@ghost

Description

The follow type of rule causes the ocaml printer to crash
test. A ::= "{{" Id "}" "}" ; -- Note: should be "}}"

The error message is Fatal error: exception Invalid_argument("Bytes.create")

I have traced this to the indent function let indent (i: int) : string = "\n" ^ String.make i ' ' and I think that changed to let indent (i: int) : string = if i > 0 then "\n" ^ String.make i ' ' else "\n" ;; to match the behavior of other backends.

Metadata

Metadata

Assignees

Labels

OCamlprinterConcerning the generated printer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions