diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-16 21:52:13 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-04-18 22:15:35 +0800 |
commit | 55c84777ee638be8735a5c421941e7eb71633bdf (patch) | |
tree | d7e686884a5caa82209b2d57db5c38d2f468ec4e /BaseTools/Source/Python/GenFds/FdfParser.py | |
parent | 5a693b89a1976f13d32a3ed302f5d6e0664979d6 (diff) | |
download | edk2-55c84777ee638be8735a5c421941e7eb71633bdf.tar.gz edk2-55c84777ee638be8735a5c421941e7eb71633bdf.tar.bz2 edk2-55c84777ee638be8735a5c421941e7eb71633bdf.zip |
BaseTools: use predefined constants instead of local strings
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/Source/Python/GenFds/FdfParser.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index dce41701a5..bff1d47393 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -52,6 +52,7 @@ from Common.String import NormPath import Common.GlobalData as GlobalData
from Common.Expression import *
from Common import GlobalData
+from Common.DataType import *
from Common.String import ReplaceMacro
import uuid
from Common.Misc import tdict
@@ -511,8 +512,8 @@ class FdfParser: if Item == '' or Item == 'RULE':
return
- if Item == 'DEFINES':
- self.__CurSection = ['COMMON', 'COMMON', 'COMMON']
+ if Item == TAB_COMMON_DEFINES.upper():
+ self.__CurSection = [TAB_COMMON, TAB_COMMON, TAB_COMMON]
elif Item == 'VTF' and len(ItemList) == 3:
UiName = ItemList[2]
Pos = UiName.find(',')
@@ -520,9 +521,9 @@ class FdfParser: UiName = UiName[:Pos]
self.__CurSection = ['VTF', UiName, ItemList[1]]
elif len(ItemList) > 1:
- self.__CurSection = [ItemList[0], ItemList[1], 'COMMON']
+ self.__CurSection = [ItemList[0], ItemList[1], TAB_COMMON]
elif len(ItemList) > 0:
- self.__CurSection = [ItemList[0], 'DUMMY', 'COMMON']
+ self.__CurSection = [ItemList[0], 'DUMMY', TAB_COMMON]
## PreprocessFile() method
#
@@ -886,7 +887,7 @@ class FdfParser: if self.__CurSection:
# Defines macro
- ScopeMacro = self.__MacroDict['COMMON', 'COMMON', 'COMMON']
+ ScopeMacro = self.__MacroDict[TAB_COMMON, TAB_COMMON, TAB_COMMON]
if ScopeMacro:
MacroDict.update(ScopeMacro)
@@ -3586,7 +3587,7 @@ class FdfParser: raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)
Arch = self.__SkippedChars.rstrip(".")
- if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "AARCH64", "COMMON"):
+ if Arch.upper() not in ARCH_LIST_FULL:
raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
ModuleType = self.__GetModuleType()
|