From 4afd3d042215afe68d00b9ab8c32f063a3a1c03f Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Fri, 23 Aug 2013 02:18:16 +0000 Subject: Sync BaseTool trunk (version r2599) into EDKII BaseTools. Signed-off-by: Liming Gao Reviewed-by: Heshen Chen git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14591 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/AutoGen/UniClassObject.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen/UniClassObject.py') 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.
+# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
# 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 + "'" -- cgit v1.2.3