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

Side by Side Diff: tools/binary_size/libsupersize/match_util.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 """Regular expression helpers.""" 5 """Regular expression helpers."""
6 6
7 import re 7 import re
8 8
9 9
10 def _CreateIdentifierRegex(parts): 10 def _CreateIdentifierRegex(parts):
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 To match part of a name, use {{_some_name_}}. This will additionally match: 50 To match part of a name, use {{_some_name_}}. This will additionally match:
51 kPrefixSomeNameSuffix, PREFIX_SOME_NAME_SUFFIX, etc. 51 kPrefixSomeNameSuffix, PREFIX_SOME_NAME_SUFFIX, etc.
52 52
53 Note: SymbolGroup.Where* methods call this function already, so there is 53 Note: SymbolGroup.Where* methods call this function already, so there is
54 generally no need to call it directly. 54 generally no need to call it directly.
55 """ 55 """
56 return re.sub(r'\{\{(.*?)\}\}', 56 return re.sub(r'\{\{(.*?)\}\}',
57 lambda m: _CreateIdentifierRegex(m.group(1).split('_')), 57 lambda m: _CreateIdentifierRegex(m.group(1).split('_')),
58 pattern) 58 pattern)
OLDNEW
« no previous file with comments | « tools/binary_size/libsupersize/main.py ('k') | tools/binary_size/libsupersize/match_util_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698