diff options
author | Guido van Rossum <guido@python.org> | 1994-10-03 16:45:35 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-10-03 16:45:35 (GMT) |
commit | 07c9645413543acbf6dff349c02e3be2bf2bc5a4 (patch) | |
tree | c40f9b1d06695b410be453362b37aa9671762154 /Tools/scripts/fixcid.py | |
parent | 011813444cc1cae2d60a29750e719743edaa4b14 (diff) | |
download | cpython-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-x | Tools/scripts/fixcid.py | 7 |
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 |