Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite camel_case_to_capitalized_snake_case with OCamLe #12

Open
cedlemo opened this issue Jan 11, 2018 · 0 comments
Open

Rewrite camel_case_to_capitalized_snake_case with OCamLe #12

cedlemo opened this issue Jan 11, 2018 · 0 comments

Comments

@cedlemo
Copy link
Owner

cedlemo commented Jan 11, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant