Is there a list of reserved words for Reason? (aka reserved keywords, identifiers)


Is there a list of reserved words for Reason?


I just tried to make a record type like so:

type todo = {done: bool, description:string};

That doesn’t work because done is apparently a reserved word. Knowing what reserved words are I tried searching for a list of those words. Similar to this for JavaScript.

I could not find one. Or perhaps I’m using the wrong search terms.

I did find this page with lexical grammar for OCaml. And we probably cannot use any of those in Reason code (right?).

For Reason I did find these two API reference pages:

But they don’t say anything about the done keyword.

So my question remains.

If there’s no such list: shall I have a go at making one?


Reason has introduced a few new keywords (switch instead of match for example) but most OCaml keywords should be Reason keywords as well. They’re listed here:


It would be really useful if in addition to having all the reserved words documented, we also had really nice errors for them with the -bs-super-errors flag. Currently that one is just plain "Error: 506: ", which isn’t very helpful. One that’s bit me before is end in type dur = {start: string, end: string};.

See also


Has there been any progress in a full list of reserved keywords for Reason and not just OCaml?


We are currently in the process on gathering missing information for the documentation. A list of reserved keywords for Reason is definitely very high on our list!


For those interested, I opened an issue to keep track of this:

Feel free to add more feedback on what is missing / is unclear in the current documentation. The more input we have, the better!