]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Parser/InfParser.py
This patch is going to:
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Parser / InfParser.py
index 8a41eca0a71dc0b8ba31be343768aa05cf3e5e0e..e7bef2e35e0fea430aefb135d2f39ccb7af214fc 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file contained the parser for INF file\r
 #\r
-# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -210,7 +210,7 @@ class InfParser(InfSectionParser):
                 SectionLines.append((Line, LineNo))\r
                 HeaderCommentStart = True\r
                 continue        \r
-            \r
+\r
             #\r
             # Collect Header content.\r
             #\r
@@ -227,18 +227,18 @@ class InfParser(InfSectionParser):
                 HeaderCommentEnd = True\r
                 BinaryHeaderCommentStart = False \r
                 BinaryHeaderCommentEnd   = False\r
-                HeaderCommentStart = False\r
+                HeaderCommentStart = False      \r
                 if Line.find(DT.TAB_BINARY_HEADER_COMMENT) > -1:\r
                     self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName) \r
                     SectionLines = []\r
                 else:\r
                     SectionLines.append((Line, LineNo))\r
-                #\r
-                # Call Header comment parser.\r
-                #\r
-                self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName)\r
-                SectionLines = []\r
-                continue\r
+                    #\r
+                    # Call Header comment parser.\r
+                    #\r
+                    self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName)\r
+                    SectionLines = []\r
+                    continue\r
 \r
             #\r
             # check whether binary header comment section started\r
@@ -254,9 +254,9 @@ class InfParser(InfSectionParser):
                 BinaryHeaderStarLineNo = LineNo\r
                 SectionLines.append((Line, LineNo))\r
                 BinaryHeaderCommentStart = True\r
-                HeaderCommentEnd = True               \r
-                continue                   \r
\r
+                HeaderCommentEnd = True\r
+                continue   \r
+            \r
             #\r
             # check whether there are more than one binary header exist\r
             #\r
@@ -302,12 +302,12 @@ class InfParser(InfSectionParser):
                 SectionLines.append((Line, LineNo))\r
                 if not LastSectionFalg:\r
                     continue\r
-                        \r
+\r
             #\r
             # Encountered a section. start with '[' and end with ']'\r
             #\r
             if (Line.startswith(DT.TAB_SECTION_START) and \\r
-               Line.find(DT.TAB_SECTION_END) > -1) or LastSectionFalg:                  \r
+               Line.find(DT.TAB_SECTION_END) > -1) or LastSectionFalg:   \r
                 \r
                 HeaderCommentEnd = True        \r
                 BinaryHeaderCommentEnd = True       \r
@@ -324,13 +324,13 @@ class InfParser(InfSectionParser):
                                      File=self.FullPath,\r
                                      Line=LineNo, \r
                                      ExtraData=Line)                        \r
-                        \r
+\r
                     #\r
                     # Keep last time section header content for section parser\r
                     # usage.\r
                     #\r
                     self.LastSectionHeaderContent = deepcopy(self.SectionHeaderContent)\r
-                \r
+\r
                     #\r
                     # TailComments in section define.\r
                     #\r
@@ -357,11 +357,11 @@ class InfParser(InfSectionParser):
                     # Compare the new section name with current\r
                     #\r
                     self.SectionHeaderParser(Line, self.FileName, LineNo)\r
-                    \r
+\r
                     self._CheckSectionHeaders(Line, LineNo)\r
 \r
                     SectionType = _ConvertSecNameToType(self.SectionHeaderContent[0][0])\r
-                \r
+\r
                 if not FirstSectionStartFlag:\r
                     CurrentSection = SectionType\r
                     FirstSectionStartFlag = True\r
@@ -370,10 +370,10 @@ class InfParser(InfSectionParser):
             else:\r
                 SectionLines.append((Line, LineNo))\r
                 continue\r
-                                                        \r
+\r
             if LastSectionFalg:\r
                 SectionLines, CurrentSection = self._ProcessLastSection(SectionLines, Line, LineNo, CurrentSection)\r
-                         \r
+\r
             #\r
             # End of section content collect.\r
             # Parser the section content collected previously.\r
@@ -393,9 +393,9 @@ class InfParser(InfSectionParser):
         \r
         if HeaderStarLineNo == -1:\r
             Logger.Error("InfParser", \r
-                         FORMAT_INVALID, \r
-                         ST.ERR_NO_SOURCE_HEADER, \r
-                         File=self.FullPath)\r
+                        FORMAT_INVALID,\r
+                        ST.ERR_NO_SOURCE_HEADER,\r
+                        File=self.FullPath) \r
         if BinaryHeaderStarLineNo > -1 and HeaderStarLineNo > -1  and HeaderStarLineNo > BinaryHeaderStarLineNo:\r
             Logger.Error("InfParser", \r
                         FORMAT_INVALID,\r