diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-03-30 05:38:07 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-04-03 17:36:15 +0800 |
commit | 147a656b3414667aeafdad0a8fd5504ddad96367 (patch) | |
tree | 0774e74cae4f3afee7b7078d5f2f0410baff9488 /BaseTools | |
parent | 4f9e71e1f75cafa2ed1c87e8a4e91b9f1f23c90a (diff) | |
download | edk2-147a656b3414667aeafdad0a8fd5504ddad96367.tar.gz edk2-147a656b3414667aeafdad0a8fd5504ddad96367.tar.bz2 edk2-147a656b3414667aeafdad0a8fd5504ddad96367.zip |
BaseTools: use new RegEx from FdfParserLite
FdfParser has identical one. import and share.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 346f4eeb03..b3f83c072a 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -60,7 +60,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open from Capsule import EFI_CERT_TYPE_PKCS7_GUID
from Capsule import EFI_CERT_TYPE_RSA2048_SHA256_GUID
from Common.RangeExpression import RangeExpression
-from Common.FdfParserLite import FileExtensionPattern
+from Common.FdfParserLite import FileExtensionPattern,TokenFindPattern
##define T_CHAR_SPACE ' '
##define T_CHAR_NULL '\0'
@@ -2797,12 +2797,11 @@ class FdfParser: def __GetFileOpts(self, FfsFileObj):
if self.__GetNextToken():
- Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
- if Pattern.match(self.__Token):
+ if TokenFindPattern.match(self.__Token):
FfsFileObj.KeyStringList.append(self.__Token)
if self.__IsToken(","):
while self.__GetNextToken():
- if not Pattern.match(self.__Token):
+ if not TokenFindPattern.match(self.__Token):
raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
FfsFileObj.KeyStringList.append(self.__Token)
@@ -3746,12 +3745,11 @@ class FdfParser: KeyStringList = []
if self.__GetNextToken():
- Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
- if Pattern.match(self.__Token):
+ if TokenFindPattern.match(self.__Token):
KeyStringList.append(self.__Token)
if self.__IsToken(","):
while self.__GetNextToken():
- if not Pattern.match(self.__Token):
+ if not TokenFindPattern.match(self.__Token):
raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
KeyStringList.append(self.__Token)
|