BaseTools: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
## @file
|
||||
# This file contained the parser for [Depex] sections in INF file
|
||||
# This file contained the parser for [Depex] sections in INF file
|
||||
#
|
||||
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# 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
|
||||
# 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
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
@ -29,7 +29,7 @@ from Parser.InfParserMisc import InfParserSectionRoot
|
||||
class InfDepexSectionParser(InfParserSectionRoot):
|
||||
## InfDepexParser
|
||||
#
|
||||
# For now, only separate Depex String and comments.
|
||||
# For now, only separate Depex String and comments.
|
||||
# Have two types of section header.
|
||||
# 1. [Depex.Arch.ModuleType, ...]
|
||||
# 2. [Depex.Arch|FFE, ...]
|
||||
@ -44,7 +44,7 @@ class InfDepexSectionParser(InfParserSectionRoot):
|
||||
for Line in SectionString:
|
||||
LineContent = Line[0]
|
||||
LineNo = Line[1]
|
||||
|
||||
|
||||
#
|
||||
# Found comment
|
||||
#
|
||||
@ -54,34 +54,34 @@ class InfDepexSectionParser(InfParserSectionRoot):
|
||||
#
|
||||
# Replace with [Defines] section Macro
|
||||
#
|
||||
LineContent = InfExpandMacro(LineContent,
|
||||
(FileName, LineContent, Line[1]),
|
||||
self.FileLocalMacros,
|
||||
LineContent = InfExpandMacro(LineContent,
|
||||
(FileName, LineContent, Line[1]),
|
||||
self.FileLocalMacros,
|
||||
None, True)
|
||||
|
||||
|
||||
CommentCount = LineContent.find(DT.TAB_COMMENT_SPLIT)
|
||||
|
||||
|
||||
if CommentCount > -1:
|
||||
DepexComment.append((LineContent[CommentCount:], LineNo))
|
||||
DepexComment.append((LineContent[CommentCount:], LineNo))
|
||||
LineContent = LineContent[:CommentCount-1]
|
||||
|
||||
|
||||
|
||||
|
||||
CommentCount = -1
|
||||
DepexContent.append((LineContent, LineNo))
|
||||
|
||||
|
||||
TokenList = GetSplitValueList(LineContent, DT.TAB_COMMENT_SPLIT)
|
||||
ValueList[0:len(TokenList)] = TokenList
|
||||
|
||||
|
||||
#
|
||||
# Current section archs
|
||||
#
|
||||
#
|
||||
KeyList = []
|
||||
LastItem = ''
|
||||
for Item in self.LastSectionHeaderContent:
|
||||
LastItem = Item
|
||||
if (Item[1], Item[2], Item[3]) not in KeyList:
|
||||
KeyList.append((Item[1], Item[2], Item[3]))
|
||||
|
||||
KeyList.append((Item[1], Item[2], Item[3]))
|
||||
|
||||
NewCommentList = []
|
||||
FormatCommentLn = -1
|
||||
ReFormatComment = re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)
|
||||
@ -90,15 +90,15 @@ class InfDepexSectionParser(InfParserSectionRoot):
|
||||
if ReFormatComment.match(CommentContent) is not None:
|
||||
FormatCommentLn = CommentItem[1] + 1
|
||||
continue
|
||||
|
||||
|
||||
if CommentItem[1] != FormatCommentLn:
|
||||
NewCommentList.append(CommentContent)
|
||||
else:
|
||||
FormatCommentLn = CommentItem[1] + 1
|
||||
|
||||
|
||||
if not InfSectionObject.SetDepex(DepexContent, KeyList = KeyList, CommentList = NewCommentList):
|
||||
Logger.Error('InfParser',
|
||||
Logger.Error('InfParser',
|
||||
FORMAT_INVALID,
|
||||
ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[Depex]"),
|
||||
File=FileName,
|
||||
Line=LastItem[3])
|
||||
File=FileName,
|
||||
Line=LastItem[3])
|
||||
|
Reference in New Issue
Block a user