summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Workspace/MetaFileParser.py
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-18 12:17:25 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-18 12:17:25 +0000
commitb36d134faf4305247830522b8e2bb255e98c5699 (patch)
treeec37795cbc86b693528a062030cb516039bcb1c2 /BaseTools/Source/Python/Workspace/MetaFileParser.py
parente7fe4028631b6a7d70e3c02c7c40ff1504321daa (diff)
downloadedk2-platforms-b36d134faf4305247830522b8e2bb255e98c5699.tar.xz
Sync BaseTools Branch (version r2321) to EDKII main trunk.
Signed-off-by: lgao4 Reviewed-by: gikidy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12372 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py')
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileParser.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 7f34f49c95..fabc7ed986 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -338,10 +338,10 @@ class InfParser(MetaFileParser):
NextLine = CleanString(self._Content[Index + 1])
if Line == '':
continue
- if Line.find(DataType.TAB_COMMENT_R8_START) > -1:
+ if Line.find(DataType.TAB_COMMENT_EDK_START) > -1:
IsFindBlockComment = True
continue
- if Line.find(DataType.TAB_COMMENT_R8_END) > -1:
+ if Line.find(DataType.TAB_COMMENT_EDK_END) > -1:
IsFindBlockComment = False
continue
if IsFindBlockComment:
@@ -479,7 +479,7 @@ class InfParser(MetaFileParser):
ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
self._Macros[TokenList[0]] = ReplaceMacro(TokenList[1], self._Macros, False)
- ## [nmake] section parser (R8.x style only)
+ ## [nmake] section parser (EDK.x style only)
def _NmakeParser(self):
TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
self._ValueList[0:len(TokenList)] = TokenList
@@ -519,11 +519,11 @@ class InfParser(MetaFileParser):
MODEL_UNKNOWN : MetaFileParser._Skip,
MODEL_META_DATA_HEADER : _DefineParser,
MODEL_META_DATA_BUILD_OPTION : MetaFileParser._BuildOptionParser,
- MODEL_EFI_INCLUDE : _IncludeParser, # for R8.x modules
- MODEL_EFI_LIBRARY_INSTANCE : MetaFileParser._CommonParser, # for R8.x modules
+ MODEL_EFI_INCLUDE : _IncludeParser, # for EDK.x modules
+ MODEL_EFI_LIBRARY_INSTANCE : MetaFileParser._CommonParser, # for EDK.x modules
MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,
MODEL_META_DATA_PACKAGE : MetaFileParser._PathParser,
- MODEL_META_DATA_NMAKE : _NmakeParser, # for R8.x modules
+ MODEL_META_DATA_NMAKE : _NmakeParser, # for EDK.x modules
MODEL_PCD_FIXED_AT_BUILD : _PcdParser,
MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,
MODEL_PCD_FEATURE_FLAG : _PcdParser,
@@ -894,11 +894,21 @@ class DscParser(MetaFileParser):
return self._OP_[Op](Value)
# three operands
elif TokenNumber == 3:
- TokenValue = self._EvaluateToken(TokenList[0], Expression)
+ TokenValue = TokenList[0]
+ if TokenValue[0] in ["'", '"'] and TokenValue[-1] in ["'", '"']:
+ TokenValue = TokenValue[1:-1]
+ if TokenValue.startswith("$(") and TokenValue.endswith(")"):
+ TokenValue = self._EvaluateToken(TokenValue, Expression)
+ if TokenValue[0] in ["'", '"'] and TokenValue[-1] in ["'", '"']:
+ TokenValue = TokenValue[1:-1]
if TokenValue == None:
return False
Value = TokenList[2]
if Value[0] in ["'", '"'] and Value[-1] in ["'", '"']:
+ Value = Value[1:-1]
+ if Value.startswith("$(") and Value.endswith(")"):
+ Value = self._EvaluateToken(Value, Expression)
+ if Value[0] in ["'", '"'] and Value[-1] in ["'", '"']:
Value = Value[1:-1]
Op = TokenList[1]
if Op not in self._OP_: