From 636f2be673b2f43518167d8fddae56b714f19314 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 12 Mar 2010 10:54:01 +0000 Subject: Sync EDKII BaseTools to BaseTools project r1928 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10234 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/Common/DscClassObject.py | 14 +++++++++----- BaseTools/Source/Python/Common/FdfParserLite.py | 8 ++++---- BaseTools/Source/Python/Common/Parsing.py | 16 ++++++++-------- 3 files changed, 21 insertions(+), 17 deletions(-) (limited to 'BaseTools/Source/Python/Common') diff --git a/BaseTools/Source/Python/Common/DscClassObject.py b/BaseTools/Source/Python/Common/DscClassObject.py index 50b6cc5bce..c25580ac37 100644 --- a/BaseTools/Source/Python/Common/DscClassObject.py +++ b/BaseTools/Source/Python/Common/DscClassObject.py @@ -1,7 +1,7 @@ ## @file # This file is used to define each component of DSC file # -# Copyright (c) 2007 ~ 2008, Intel Corporation +# Copyright (c) 2007 - 2010, Intel Corporation # All rights reserved. This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -989,10 +989,14 @@ class Dsc(DscObject): # elif PreviousIf[2] in (MODEL_META_DATA_CONDITIONAL_STATEMENT_IF, Model): List = PreviousIf[0].split(' ') - Value1 = List[0] - Value2 = List[1] - Value3 = List[2] - Value3 = SplitString(Value3) + Value1, Value2, Value3 = '', '==', '0' + if len(List) == 3: + Value1 = List[0] + Value2 = List[1] + Value3 = List[2] + Value3 = SplitString(Value3) + if len(List) == 1: + Value1 = List[0] Model = PreviousIf[2] self.TblDsc.Insert(Model, Value1, Value2, Value3, ArchList, BelongsToItem, self.FileID, PreviousIf[1], StartColumn, EndLine, EndColumn, Enabled) # diff --git a/BaseTools/Source/Python/Common/FdfParserLite.py b/BaseTools/Source/Python/Common/FdfParserLite.py index eb7b0d7514..b181e65d16 100644 --- a/BaseTools/Source/Python/Common/FdfParserLite.py +++ b/BaseTools/Source/Python/Common/FdfParserLite.py @@ -1760,8 +1760,8 @@ class FdfParser(object): if not self.__GetNextHexNumber(): raise Warning("expected Hex byte At Line ", self.FileName, self.CurrentLineNumber) - if len(self.__Token) > 4: - raise Warning("Hex byte(must be 2 digits) too long At Line ", self.FileName, self.CurrentLineNumber) + if len(self.__Token) > 18: + raise Warning("Hex string can't be converted to a valid UINT64 value", self.FileName, self.CurrentLineNumber) DataString = self.__Token DataString += "," @@ -1792,8 +1792,8 @@ class FdfParser(object): if not self.__GetNextHexNumber(): raise Warning("expected Hex byte At Line ", self.FileName, self.CurrentLineNumber) - if len(self.__Token) > 4: - raise Warning("Hex byte(must be 2 digits) too long At Line ", self.FileName, self.CurrentLineNumber) + if len(self.__Token) > 18: + raise Warning("Hex string can't be converted to a valid UINT64 value", self.FileName, self.CurrentLineNumber) DataString = self.__Token DataString += "," diff --git a/BaseTools/Source/Python/Common/Parsing.py b/BaseTools/Source/Python/Common/Parsing.py index 6ab91fbc33..3884b0521c 100644 --- a/BaseTools/Source/Python/Common/Parsing.py +++ b/BaseTools/Source/Python/Common/Parsing.py @@ -291,17 +291,17 @@ def QueryInfItem(Table, Model, BelongsToItem): # @retval truple() A truple structure as (Family, ToolChain, Flag) # def GetBuildOption(String, File, LineNo = -1): + (Family, ToolChain, Flag) = ('', '', '') if String.find(TAB_EQUAL_SPLIT) < 0: RaiseParserError(String, 'BuildOptions', File, '[:]=Flag', LineNo) - (Family, ToolChain, Flag) = ('', '', '') - List = GetSplitValueList(String, TAB_EQUAL_SPLIT, MaxSplit = 1) - if List[0].find(':') > -1: - Family = List[0][ : List[0].find(':')].strip() - ToolChain = List[0][List[0].find(':') + 1 : ].strip() else: - ToolChain = List[0].strip() - Flag = List[1].strip() - + List = GetSplitValueList(String, TAB_EQUAL_SPLIT, MaxSplit = 1) + if List[0].find(':') > -1: + Family = List[0][ : List[0].find(':')].strip() + ToolChain = List[0][List[0].find(':') + 1 : ].strip() + else: + ToolChain = List[0].strip() + Flag = List[1].strip() return (Family, ToolChain, Flag) ## Get Library Class -- cgit v1.2.3