Sync EDKII BaseTools to BaseTools project r1988

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10607 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8
2010-06-28 09:33:10 +00:00
parent 96dd57ee8d
commit 9053bc517e
41 changed files with 690 additions and 127 deletions

View File

@ -279,9 +279,16 @@ def CleanString(Line, CommentCharacter = DataType.TAB_COMMENT_SPLIT, AllowCppSty
if AllowCppStyleComment:
Line = Line.replace(DataType.TAB_COMMENT_R8_SPLIT, CommentCharacter)
#
# remove comments
# remove comments, but we should escape comment character in string
#
Line = Line.split(CommentCharacter, 1)[0];
InString = False
for Index in range(0, len(Line)):
if Line[Index] == '"':
InString = not InString
elif Line[Index] == CommentCharacter and not InString:
Line = Line[0: Index]
break
#
# remove whitespace again
#