diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-15 02:51:34 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-15 02:51:34 +0000 |
commit | 6780eef1f9ed0af24795708c3be7adafd7113691 (patch) | |
tree | 1a9fd2fca0bd71c4a64a8bf3f10e492f45a232d8 /BaseTools/Source/Python/GenFds/FdfParser.py | |
parent | 5460c4bbc5aa9d99d25c55c6b936166bea3dbea0 (diff) | |
download | edk2-platforms-6780eef1f9ed0af24795708c3be7adafd7113691.tar.xz |
Sync EDKII BaseTools to BaseTools project r2093.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11057 6f19259b-4bc3-4df7-8a09-765794883524
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)
|