summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py')
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py
index 332e2f0143..7e2114313e 100644
--- a/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py
+++ b/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py
@@ -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]) \ No newline at end of file
+ File=FileName,
+ Line=LastItem[3])