DescriptionAdd utility for joining names in generated code.
One common task in code generators is to append/prepend a suffix/prefix
to a name. For example, in make_computed_style_base.py, we prepend the
prefix 'set' to a name to form a setter name. Currently, we simply
concatenate the two strings together and then pass it through a name
utility like CamelCase that makes sure the final name is in the right
format. However, this is fragile, because if the name was in lower camel
case, say 'fooBar', then the concatenation is 'setfooBar', and now
'setfoo' is one word so using a name utility like CamelCase would only
produce 'SetfooBar' and not 'SetFooBar'.
This patch adds a utility function called join_name, which takes
multiple names and combines them into one name irrespective of their
individual formats.
BUG=628043
Review-Url: https://codereview.chromium.org/2785013002
Cr-Commit-Position: refs/heads/master@{#461050}
Committed: https://chromium.googlesource.com/chromium/src/+/e12d70fb8a80561804cf6b033cb355ca6fc74aed
Patch Set 1 #
Total comments: 1
Messages
Total messages: 13 (5 generated)
|