diff options
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index d11af6c134..52d32a9e98 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -565,9 +565,9 @@ class FdfParser: self.Rewind()
- ## PreprocessIncludeFile() method
+ ## PreprocessConditionalStatement() method
#
- # Preprocess file contents, replace !include statements with file contents.
+ # Preprocess conditional statement.
# In the end, rewind the file buffer pointer to the beginning
#
# @param self The object pointer
@@ -1264,6 +1264,12 @@ class FdfParser: raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
while self.__GetNextWord():
+ # handle the SET statement
+ if self.__Token == 'SET':
+ self.__UndoToken()
+ self.__GetSetStatement(None)
+ continue
+
Macro = self.__Token
if not self.__IsToken("="):
@@ -1489,7 +1495,7 @@ class FdfParser: for Item in Obj.BlockSizeList:
if Item[0] == None or Item[1] == None:
- raise Warning("expected block statement for Fd Section", self.FileName, self.CurrentLineNumber)
+ raise Warning("expected block statement", self.FileName, self.CurrentLineNumber)
## __GetBlockStatement() method
#
@@ -1508,7 +1514,7 @@ class FdfParser: raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
if not self.__GetNextHexNumber() and not self.__GetNextDecimalNumber():
- raise Warning("expected Hex block size", self.FileName, self.CurrentLineNumber)
+ raise Warning("expected Hex or Integer block size", self.FileName, self.CurrentLineNumber)
BlockSize = self.__Token
BlockSizePcd = None
@@ -1609,7 +1615,8 @@ class FdfParser: raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
Value += self.__SkippedChars
- Obj.SetVarDict[PcdPair] = Value
+ if Obj:
+ Obj.SetVarDict[PcdPair] = Value
self.Profile.PcdDict[PcdPair] = Value
return True
@@ -1904,7 +1911,8 @@ class FdfParser: self.__GetAddressStatements(FvObj)
- self.__GetBlockStatement(FvObj)
+ while self.__GetBlockStatement(FvObj):
+ pass
self.__GetSetStatements(FvObj)
|