Skip to content

Distinguishing FooBar and fooBar when converting to snake case module name #545

@daniestevez

Description

@daniestevez

I have a small patch for the module_name function in capnpc that inserts a leading _ in the module name when the camel case name begins by a lower case letter. This is intended to prevent name clashes between the module generated for something like a struct FooBar and the module generated from something like annotation fooBar (these cases occur in the capnp codebase I am using). Would this patch be something that could be contributed upstream, perhaps as an option rather than as default behaviour? I'm willing to do all the heavy lifting to submit a PR that is mergeable. I'm mostly asking for direction about what would be the preferred approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions