aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/utils.py
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-08-27 20:31:21 -0500
committerGitHub <noreply@github.com>2022-08-27 20:31:21 -0500
commitb8228a036016fa58cab4b00a2e62298df299d41f (patch)
tree37ab80c054d2c0832d0ebf61cbbefd9e368260a8 /codegen/lib/utils.py
parent029ae0e567ccdc631a358755eba43b742811ff05 (diff)
downloadazalea-drasl-b8228a036016fa58cab4b00a2e62298df299d41f.tar.xz
Azalea registry (#20)
* make azalea-registry crate * add trait feature to az-block * registr * registry macro * impl Display for registry things * registries
Diffstat (limited to 'codegen/lib/utils.py')
-rw-r--r--codegen/lib/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py
index c3d293c0..efabbb38 100644
--- a/codegen/lib/utils.py
+++ b/codegen/lib/utils.py
@@ -10,7 +10,8 @@ def to_snake_case(name: str):
def to_camel_case(name: str):
- s = re.sub('_([a-z])', lambda m: m.group(1).upper(), name)
+ s = re.sub('[_ ](\w)', lambda m: m.group(1).upper(),
+ name.replace('.', '_').replace('/', '_'))
s = upper_first_letter(s)
# if the first character is a number, we need to add an underscore
# maybe we could convert it to the number name (like 2 would become "two")?