]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: add GUID pattern to global data
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Fri, 16 Mar 2018 23:27:40 +0000 (07:27 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 29 Mar 2018 00:36:06 +0000 (08:36 +0800)
add a shared global regular expression for GUID matching

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@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>
BaseTools/Source/Python/Common/GlobalData.py

index 83ba3d19961ae1b896fb49813baf32cc40562d9a..4a85a8e0db63ccf5d26055bc012d0d657abbd156 100644 (file)
@@ -51,6 +51,13 @@ gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE
 gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")\r
 gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))\r
 \r
+# definition for a GUID.  used to create regular expressions below.\r
+_GuidPattern = r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"\r
+\r
+## Regular expressions for GUID matching\r
+gGuidPattern = re.compile(r'{}'.format(_GuidPattern))\r
+gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))\r
+\r
 #\r
 # A global variable for whether current build in AutoGen phase or not.\r
 #\r