capnproto / capnpc-rust

Cap'n Proto code generation for Rust
76 stars 26 forks source link

Include identifier in error message when finding non-alphanumeric chars #39

Closed dfaust closed 7 years ago

dfaust commented 7 years ago

Small improvement that makes it more obvious where the cause of the error lies.

dwrensha commented 7 years ago

This change looks good to me, but I'm curious: did you manage to trigger these errors when compiling a capnp schema? I would expect capnp compile to catch the non-alphanumeric identifiers before passing them to capnpc-rust.

dfaust commented 7 years ago

Yes, I hit the one in camel_to_snake_case because I had an argument for a method formatted in snake case instead of camel case.

dwrensha commented 7 years ago

Interesting! I've opened as issue upstream: https://github.com/capnproto/capnproto/issues/506

dwrensha commented 7 years ago

Thanks!