You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Maybe it is a bit silly by Ocaml to not truncate negative quantities passed to String.make. They seem to be obsessed with not a bounds check too much, living by the motto let it crash.
Anyway, I fixed this along the lines you suggested, and the fix should be on master soon. Is this fine with you or do you need a release of this fix urgently?
As a workaround, you can always patch the output of BNFC with the patch commandline tool.
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 tolet indent (i: int) : string = if i > 0 then "\n" ^ String.make i ' ' else "\n" ;;
to match the behavior of other backends.The text was updated successfully, but these errors were encountered: