]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Eot/CodeFragmentCollector.py
BaseTools: Eot tool never populates this dictionary
[mirror_edk2.git] / BaseTools / Source / Python / Eot / CodeFragmentCollector.py
index 349f934304df704e25ad4f77219ce13dafbe6f35..87f179206d846b575b836a05876cfe837ed6052d 100644 (file)
@@ -1,9 +1,9 @@
 ## @file\r
 # preprocess source file\r
 #\r
-#  Copyright (c) 2007 ~ 2010, Intel Corporation\r
+#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
-#  All rights reserved. This program and the accompanying materials\r
+#  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
 #  http://opensource.org/licenses/bsd-license.php\r
@@ -16,7 +16,7 @@
 # Import Modules\r
 #\r
 import re\r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 \r
 import antlr3\r
@@ -73,40 +73,6 @@ class CodeFragmentCollector:
         self.__Token = ""\r
         self.__SkippedChars = ""\r
 \r
-    ## __IsWhiteSpace() method\r
-    #\r
-    #   Whether char at current FileBufferPos is whitespace\r
-    #\r
-    #   @param  self        The object pointer\r
-    #   @param  Char        The char to test\r
-    #   @retval True        The char is a kind of white space\r
-    #   @retval False       The char is NOT a kind of white space\r
-    #\r
-    def __IsWhiteSpace(self, Char):\r
-        if Char in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_SPACE, T_CHAR_TAB, T_CHAR_LF):\r
-            return True\r
-        else:\r
-            return False\r
-\r
-    ## __SkipWhiteSpace() method\r
-    #\r
-    #   Skip white spaces from current char, return number of chars skipped\r
-    #\r
-    #   @param  self        The object pointer\r
-    #   @retval Count       The number of chars skipped\r
-    #\r
-    def __SkipWhiteSpace(self):\r
-        Count = 0\r
-        while not self.__EndOfFile():\r
-            Count += 1\r
-            if self.__CurrentChar() in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_LF, T_CHAR_SPACE, T_CHAR_TAB):\r
-                self.__SkippedChars += str(self.__CurrentChar())\r
-                self.__GetOneChar()\r
-\r
-            else:\r
-                Count = Count - 1\r
-                return Count\r
-\r
     ## __EndOfFile() method\r
     #\r
     #   Judge current buffer pos is at file end\r
@@ -291,7 +257,7 @@ class CodeFragmentCollector:
                 InCharLiteral = not InCharLiteral\r
             # meet new line, then no longer in a comment for // and '#'\r
             if self.__CurrentChar() == T_CHAR_LF:\r
-                if HashComment and PPDirectiveObj != None:\r
+                if HashComment and PPDirectiveObj is not None:\r
                     if PPDirectiveObj.Content.rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):\r
                         PPDirectiveObj.Content += T_CHAR_LF\r
                         PPExtend = True\r