Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: mojo/public/tools/bindings/generators/mojom_dart_generator.py

Issue 1529423002: Dart: Fix conversion of identifiers to lowerCamelCase. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/interfaces/bindings/tests/regression_tests.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/mojom_dart_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_dart_generator.py b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
index 24ffbf335e4bb6986ae54ca7b21b852e5d342c48..c0cdcbcd022d6d9e0eda3a41eb2757df75b56eff 100644
--- a/mojo/public/tools/bindings/generators/mojom_dart_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
@@ -226,10 +226,10 @@ def DartDeclType(kind):
def NameToComponent(name):
# insert '_' between anything and a Title name (e.g, HTTPEntry2FooBar ->
- # HTTP_Entry2_FooBar)
- name = re.sub('([^_])([A-Z][^A-Z_]+)', r'\1_\2', name)
+ # HTTP_Entry2_FooBar). Numbers terminate a string of lower-case characters.
+ name = re.sub('([^_])([A-Z][^A-Z1-9_]+)', r'\1_\2', name)
# insert '_' between non upper and start of upper blocks (e.g.,
- # HTTP_Entry2_FooBar -> HTTP_Entry2_Foo_Bar)
+ # HTTP_Entry2_FooBar -> HTTP_Entry2_Foo_Bar).
name = re.sub('([^A-Z_])([A-Z])', r'\1_\2', name)
return [x.lower() for x in name.split('_')]
« no previous file with comments | « mojo/public/interfaces/bindings/tests/regression_tests.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698