## @file\r
# This file is used to define common string related functions used in parsing process\r
#\r
-# Copyright (c) 2007 ~ 2008, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
+# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
if AllowCppStyleComment:\r
Line = Line.replace(DataType.TAB_COMMENT_R8_SPLIT, CommentCharacter)\r
#\r
- # remove comments\r
+ # remove comments, but we should escape comment character in string\r
#\r
- Line = Line.split(CommentCharacter, 1)[0];\r
+ InString = False\r
+ for Index in range(0, len(Line)):\r
+ if Line[Index] == '"':\r
+ InString = not InString\r
+ elif Line[Index] == CommentCharacter and not InString:\r
+ Line = Line[0: Index]\r
+ break\r
+ \r
#\r
# remove whitespace again\r
#\r