summaryrefslogtreecommitdiffstats
path: root/tools/pragmaonce
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-26 20:24:41 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-26 20:24:41 +0000
commita22347228d3f73a28313e04750f49217e4d50446 (patch)
treecd6e1f414e7283c3cb1861a3c96bae958f8dd26a /tools/pragmaonce
parent9c4cbd3e369e1695093fc766aeddc615e6a390fb (diff)
downloadchromium_src-a22347228d3f73a28313e04750f49217e4d50446.zip
chromium_src-a22347228d3f73a28313e04750f49217e4d50446.tar.gz
chromium_src-a22347228d3f73a28313e04750f49217e4d50446.tar.bz2
Review comments for pragmaonce.py
Review URL: http://codereview.chromium.org/3056020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/pragmaonce')
-rw-r--r--tools/pragmaonce/pragmaonce.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/pragmaonce/pragmaonce.py b/tools/pragmaonce/pragmaonce.py
index d3a24c5..15224c4 100644
--- a/tools/pragmaonce/pragmaonce.py
+++ b/tools/pragmaonce/pragmaonce.py
@@ -7,7 +7,7 @@ import sys
# A tool to add "#pragma once" lines to files that don't have it yet.
# Intended usage:
-# find chrome -name '*.h' -exec python tools/pragmaonce/pragmaonce.py {} \;
+# find chrome -name '*.h' -exec python tools/pragmaonce/pragmaonce.py {} \;
# Some files have absurdly long comments at the top
NUM_LINES_TO_SCAN_FOR_GUARD = 250
@@ -19,8 +19,8 @@ def main(filename):
index = -1
for i in xrange(min(NUM_LINES_TO_SCAN_FOR_GUARD, len(lines) - 1)):
- m1 = re.match(r'^#ifndef ([A-Z_]+)', lines[i])
- m2 = re.match(r'^#define ([A-Z_]+)', lines[i + 1])
+ m1 = re.match(r'^#ifndef ([A-Z_0-9]+)$', lines[i])
+ m2 = re.match(r'^#define ([A-Z_0-9]+)$', lines[i + 1])
if m1 and m2:
if m1.group(1) != m2.group(1):
print 'Skipping', filename, \