diff options
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/UniClassObject.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/UniClassObject.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py index ea27607fce..7b1ce72ea7 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -1,4 +1,4 @@ -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -38,6 +38,9 @@ LF = u'\u000A' NULL = u'\u0000'
TAB = u'\t'
BACK_SPLASH = u'\\'
+DOBULE_QUOTED_SPLASH = u'\\"'
+SIGLE_QUOTED_SPLASH = u"\\'"
+TAB_BACK_SLASH = u"\\/"
gIncludePattern = re.compile("^#include +[\"<]+([^\"< >]+)[>\"]+$", re.MULTILINE | re.UNICODE)
@@ -334,11 +337,11 @@ class UniFileClassObject(object): Line = Line.replace(u'/language', u'#language')
Line = Line.replace(u'/include', u'#include')
+ Line = Line.replace(u'\\\\', u'\u0006')
Line = Line.replace(UNICODE_WIDE_CHAR, WIDE_CHAR)
Line = Line.replace(UNICODE_NARROW_CHAR, NARROW_CHAR)
Line = Line.replace(UNICODE_NON_BREAKING_CHAR, NON_BREAKING_CHAR)
- Line = Line.replace(u'\\\\', u'\u0006')
Line = Line.replace(u'\\r\\n', CR + LF)
Line = Line.replace(u'\\n', CR + LF)
Line = Line.replace(u'\\r', CR)
@@ -346,7 +349,10 @@ class UniFileClassObject(object): Line = Line.replace(u'''\"''', u'''"''')
Line = Line.replace(u'\t', u' ')
Line = Line.replace(u'\u0006', u'\\')
-
+ Line = Line.replace(DOBULE_QUOTED_SPLASH, u'"')
+ Line = Line.replace(SIGLE_QUOTED_SPLASH, u"'")
+ Line = Line.replace(TAB_BACK_SLASH, u"/")
+
# if Line.find(u'\\x'):
# hex = Line[Line.find(u'\\x') + 2 : Line.find(u'\\x') + 6]
# hex = "u'\\u" + hex + "'"
|