summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/fixcid.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-10-03 16:45:35 (GMT)
committerGuido van Rossum <guido@python.org>1994-10-03 16:45:35 (GMT)
commit07c9645413543acbf6dff349c02e3be2bf2bc5a4 (patch)
treec40f9b1d06695b410be453362b37aa9671762154 /Tools/scripts/fixcid.py
parent011813444cc1cae2d60a29750e719743edaa4b14 (diff)
downloadcpython-07c9645413543acbf6dff349c02e3be2bf2bc5a4.zip
cpython-07c9645413543acbf6dff349c02e3be2bf2bc5a4.tar.gz
cpython-07c9645413543acbf6dff349c02e3be2bf2bc5a4.tar.bz2
Get rid of freeze (now its own directory).
Added some new demos. Fixed a few others.
Diffstat (limited to 'Tools/scripts/fixcid.py')
-rwxr-xr-xTools/scripts/fixcid.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Tools/scripts/fixcid.py b/Tools/scripts/fixcid.py
index ce3f1f3..3b37bb8 100755
--- a/Tools/scripts/fixcid.py
+++ b/Tools/scripts/fixcid.py
@@ -194,7 +194,7 @@ def fix(filename):
# Tokenizing ANSI C (partly)
-Identifier = '[a-zA-Z_][a-zA-Z0-9_]+'
+Identifier = '\(struct \)?[a-zA-Z_][a-zA-Z0-9_]+'
String = '"\([^\n\\"]\|\\\\.\)*"'
Char = '\'\([^\n\\\']\|\\\\.\)*\''
CommentStart = '/\*'
@@ -246,6 +246,7 @@ def fixline(line):
if Program is InsideCommentProgram:
if not Docomments:
print 'Found in comment:', found
+ i = i + n
continue
if NotInComment.has_key(found):
## print 'Ignored in comment:',
@@ -290,7 +291,9 @@ def addsubst(substfile):
i = -1 # Happens to delete trailing \n
words = string.split(line[:i])
if not words: continue
- if len(words) <> 2:
+ if len(words) == 3 and words[0] == 'struct':
+ words[:2] == [words[0] + ' ' + words[1]]
+ elif len(words) <> 2:
err(substfile + ':' + `lineno` +
': warning: bad line: ' + line)
continue