Open aryx opened 1 year ago
cc @mjambon
it was because of the ?type: string option
still, a better error message would be nice.
Low priority.
This happens because type
is a keyword. I think it's a matter of adding a case for handling the error in the menhir file. Here's a minimal atd file with this error:
$ cat bug.atd
type t = { type: string }
$ atdgen bug.atd
Fatal error: exception Atd.Parser.MenhirBasics.Error
(btw, I don't know why I'm not getting a stack trace. I'm using atdgen 2.11.0 as shipped by opam 2.1.0 with ocaml 4.14.0)
Even if not closed, the existence of this issue is sufficient to be able to search for, and find, this particular error message. (I just did, having started experimenting with atdgen, so thanks for this!)
With this file:
atdgen rule_schema_v2.atd generates:
instead of a clear parsing error.