| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |