summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>2018-03-17 07:27:39 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-03-29 08:35:17 +0800
commit0f17c9fef104d5f0eaa382266e0489f1fa0ed986 (patch)
tree3df0ca808d8595fed18e81ce36174a8ca8f1f459 /BaseTools/Source
parent4d603daa3a2276d98ac6749d1db8e327ff7c1f5f (diff)
downloadedk2-0f17c9fef104d5f0eaa382266e0489f1fa0ed986.tar.gz
edk2-0f17c9fef104d5f0eaa382266e0489f1fa0ed986.tar.bz2
edk2-0f17c9fef104d5f0eaa382266e0489f1fa0ed986.zip
BaseTools: GlobalData share same MACRO name definition
use the same MACRO name definition across shared regular expression patterns. 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>
Diffstat (limited to 'BaseTools/Source')
-rw-r--r--BaseTools/Source/Python/Common/GlobalData.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py
index 8b36a1b773..83ba3d1996 100644
--- a/BaseTools/Source/Python/Common/GlobalData.py
+++ b/BaseTools/Source/Python/Common/GlobalData.py
@@ -1,7 +1,7 @@
## @file
# This file is used to define common static strings used by INF/DEC/DSC files
#
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2018, 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
@@ -43,10 +43,13 @@ gBuildingModule = ''
gSkuids = []
gDefaultStores = []
+# definition for a MACRO name. used to create regular expressions below.
+_MacroNamePattern = "[A-Z][A-Z0-9_]*"
+
## Regular expression for matching macro used in DSC/DEC/INF file inclusion
-gMacroRefPattern = re.compile("\$\(([A-Z][_A-Z0-9]*)\)", re.UNICODE)
+gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)
gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
-gMacroNamePattern = re.compile("^[A-Z][A-Z0-9_]*$")
+gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))
#
# A global variable for whether current build in AutoGen phase or not.