fix shape field error mismatch + port int_of_string_opt
Summary:
Ocaml checks shape's field, if it is a number lowerer reports error. Ocaml's `int_of_string_opt` allow "_" and it also allows different bases. To match its behavior. Rust's from_str_radix` dosn't allow it. This diff ports https://github.com/ocaml/ocaml/blob/
6efe8fea5b6c3f1db22e50e8b164d6ffec85578d/runtime/ints.c
This is an example Hack semantics inherits from one Ocaml's function. In long run, we need to have a spec of shape field string literal.
Reviewed By: losvald
Differential Revision:
D18052500
fbshipit-source-id:
d1522da041ce6fbdc8ba442bb328b6f0e74a635a