]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/UniClassObject.py
BaseTools: Clear build versions to sync with buildtools/BaseTools
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / UniClassObject.py
index ea27607fce6dbb668a37881748b972b13fec4351..7b1ce72ea7c0b64b902d15cf6c5ca0704d4dcfcd 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2012, 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
@@ -38,6 +38,9 @@ LF = u'\u000A'
 NULL = u'\u0000'\r
 TAB = u'\t'\r
 BACK_SPLASH = u'\\'\r
+DOBULE_QUOTED_SPLASH = u'\\"'\r
+SIGLE_QUOTED_SPLASH = u"\\'"\r
+TAB_BACK_SLASH = u"\\/"\r
 \r
 gIncludePattern = re.compile("^#include +[\"<]+([^\"< >]+)[>\"]+$", re.MULTILINE | re.UNICODE)\r
 \r
@@ -334,11 +337,11 @@ class UniFileClassObject(object):
             Line = Line.replace(u'/language', u'#language')\r
             Line = Line.replace(u'/include', u'#include')\r
 \r
+            Line = Line.replace(u'\\\\', u'\u0006')\r
             Line = Line.replace(UNICODE_WIDE_CHAR, WIDE_CHAR)\r
             Line = Line.replace(UNICODE_NARROW_CHAR, NARROW_CHAR)\r
             Line = Line.replace(UNICODE_NON_BREAKING_CHAR, NON_BREAKING_CHAR)\r
 \r
-            Line = Line.replace(u'\\\\', u'\u0006')\r
             Line = Line.replace(u'\\r\\n', CR + LF)\r
             Line = Line.replace(u'\\n', CR + LF)\r
             Line = Line.replace(u'\\r', CR)\r
@@ -346,7 +349,10 @@ class UniFileClassObject(object):
             Line = Line.replace(u'''\"''', u'''"''')\r
             Line = Line.replace(u'\t', u' ')\r
             Line = Line.replace(u'\u0006', u'\\')\r
-            \r
+            Line = Line.replace(DOBULE_QUOTED_SPLASH, u'"')\r
+            Line = Line.replace(SIGLE_QUOTED_SPLASH, u"'")\r
+            Line = Line.replace(TAB_BACK_SLASH, u"/")\r
+\r
 #           if Line.find(u'\\x'):\r
 #               hex = Line[Line.find(u'\\x') + 2 : Line.find(u'\\x') + 6]\r
 #               hex = "u'\\u" + hex + "'"\r