-
Notifications
You must be signed in to change notification settings - Fork 4
Description
- https://discuss.ocaml.org/t/convert-camelcase-string-to-capitalized-snake-case-without-regex/774/12
- http://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html
- https://realworldocaml.org/v1/en/html/parsing-with-ocamllex-and-menhir.html
- https://medium.com/@huund/recipes-for-ocamllex-bb4efa0afe53
see first implementation cedlemo/OCaml-GObject-Introspection@5e1faaa
https://github.com/cedlemo/OCaml-GObject-Introspection/blob/master/lib/lexer.mll
- find a better name ?
- improve with
IOChannel->IO_channel?
When a string does not correspond to the pattern of Lexer.snake_case, there is an exception:
Fatal error: exception GObject_introspection__Lexer.Error("illegal character 'c'"
How to catch it ?
there is an issue with the skip functionnalities,
in the Loader when Binding_utils.match_on_of is used, it is checked on the C name (ByteArray) for example while every where else, it is used on the binding name that is build with the lexer.
The problem is that in Loader I can not use the lexer directly because,
the function get_binding_name raise an error with:
- constant name
A_CONSTANT_NAME - function name
a_function_name
Should the lexer raise an error, should it return the non modified string if it does not match ?
for now, the skip list will contain both C name and Ocaml binding names.