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

Unified Diff: Source/build/scripts/name_utilities.py

Issue 27009005: Generate HTMLElementFactory with Python (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Actually use the code Created 7 years, 2 months 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
Index: Source/build/scripts/name_utilities.py
diff --git a/Source/build/scripts/name_utilities.py b/Source/build/scripts/name_utilities.py
index cb677c52406061bfbef38286b048086d8e03e680..2df84622fc7f5810f78f4b32af88b53065132801 100644
--- a/Source/build/scripts/name_utilities.py
+++ b/Source/build/scripts/name_utilities.py
@@ -44,6 +44,13 @@ def lower_first(name):
return name[0].lower() + name[1:]
+def upper_first(name):
+ for acronym in ACRONYMS:
+ if name.startswith(acronym.lower()):
+ return name.replace(acronym.lower(), acronym)
+ return name[0].upper() + name[1:]
+
+
def to_macro_style(name):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).upper()
« no previous file with comments | « Source/build/scripts/make_qualified_names.py ('k') | Source/build/scripts/templates/ElementFactory.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698