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

Side by Side Diff: tools/binary_size/libsupersize/function_signature.py

Issue 2813963002: //tools/binary_size: Consolidate most tools into "supersize" command (Closed)
Patch Set: Fix readme formatting. Make archive's --outoput-file a positional arg Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 # Copyright 2017 The Chromium Authors. All rights reserved. 1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Logic for parsing a C/C++ function signature.""" 5 """Logic for parsing a C/C++ function signature."""
6 6
7 7
8 def _FindParameterListParen(name): 8 def _FindParameterListParen(name):
9 """Finds index of the "(" that denotes the start of a paremeter list.""" 9 """Finds index of the "(" that denotes the start of a paremeter list."""
10 # This loops from left-to-right, but the only reason (I think) that this 10 # This loops from left-to-right, but the only reason (I think) that this
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 """ 95 """
96 left_paren_idx = _FindParameterListParen(name) 96 left_paren_idx = _FindParameterListParen(name)
97 97
98 if left_paren_idx > 0: 98 if left_paren_idx > 0:
99 right_paren_idx = name.rindex(')') 99 right_paren_idx = name.rindex(')')
100 assert right_paren_idx > left_paren_idx 100 assert right_paren_idx > left_paren_idx
101 space_idx = _FindReturnValueSpace(name, left_paren_idx) 101 space_idx = _FindReturnValueSpace(name, left_paren_idx)
102 return (name[space_idx + 1:], 102 return (name[space_idx + 1:],
103 name[space_idx + 1:left_paren_idx] + name[right_paren_idx + 1:]) 103 name[space_idx + 1:left_paren_idx] + name[right_paren_idx + 1:])
104 return name, name 104 return name, name
OLDNEW
« no previous file with comments | « tools/binary_size/libsupersize/file_format.py ('k') | tools/binary_size/libsupersize/function_signature_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698