From b36d134faf4305247830522b8e2bb255e98c5699 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Sun, 18 Sep 2011 12:17:25 +0000 Subject: 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 --- .../Source/Python/Workspace/MetaFileParser.py | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py') 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,10 +894,20 @@ 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] -- cgit v1.2.3