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

Issue 2785013002: Add utility for joining names in generated code. (Closed)

Created:
3 years, 8 months ago by shend
Modified:
3 years, 8 months ago
Reviewers:
meade_UTC10, Bugs Nash
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -7 lines) Patch
M third_party/WebKit/Source/build/scripts/make_computed_style_base.py View 3 chunks +8 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/build/scripts/name_utilities.py View 1 chunk +8 lines, -0 lines 1 comment Download

Messages

Total messages: 13 (5 generated)
shend
Hi Bugs, PTAL :)
3 years, 8 months ago (2017-03-30 01:16:44 UTC) #2
Bugs Nash
https://codereview.chromium.org/2785013002/diff/1/third_party/WebKit/Source/build/scripts/name_utilities.py File third_party/WebKit/Source/build/scripts/name_utilities.py (right): https://codereview.chromium.org/2785013002/diff/1/third_party/WebKit/Source/build/scripts/name_utilities.py#newcode163 third_party/WebKit/Source/build/scripts/name_utilities.py:163: return ' '.join(result) why is the result space separated? ...
3 years, 8 months ago (2017-03-30 01:39:34 UTC) #3
shend
On 2017/03/30 at 01:39:34, bugsnash wrote: > https://codereview.chromium.org/2785013002/diff/1/third_party/WebKit/Source/build/scripts/name_utilities.py > File third_party/WebKit/Source/build/scripts/name_utilities.py (right): > > https://codereview.chromium.org/2785013002/diff/1/third_party/WebKit/Source/build/scripts/name_utilities.py#newcode163 ...
3 years, 8 months ago (2017-03-30 02:03:22 UTC) #4
Bugs Nash
On 2017/03/30 at 02:03:22, shend wrote: > On 2017/03/30 at 01:39:34, bugsnash wrote: > > ...
3 years, 8 months ago (2017-03-30 02:33:03 UTC) #5
shend
Hi Eddy, PTAL
3 years, 8 months ago (2017-03-30 02:35:09 UTC) #7
meade_UTC10
lgtm
3 years, 8 months ago (2017-03-30 03:04:56 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2785013002/1
3 years, 8 months ago (2017-03-31 04:08:05 UTC) #10
commit-bot: I haz the power
3 years, 8 months ago (2017-03-31 05:43:05 UTC) #13
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/e12d70fb8a80561804cf6b033cb3...

Powered by Google App Engine
This is Rietveld 408576698