Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefix JS keywords that are used as OCaml identifiers.
We were already disallowing some JS keywords from being used as identifiers, this patch completes the set of recognised keywords. Instead of disallowing, we can safely prefix or suffix the name with a character that is not permitted in OCaml identifiers, but is permitted in JS identifiers. This includes $ and a substantial set of unicode characters. (Those listed in the below tables, AND contain at least one byte that is forbidden by the OCaml rules). In this case, I've opted to prefix the variables by 𝕍 (Mathematical Double-Struck Capital V). I've also updated the substitution of the ' (Apostrophe) character from $ to ʹ (Modifier Letter Prime), to improve the readability of the code. https://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:ID_Start=Yes:] https://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:ID_Continue=Yes:]
- Loading branch information