]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/MetaFileParser.py
BaseTools: fix imports
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / MetaFileParser.py
index 032220813b41ca8cfe8c9fb5c6e482ecdd829b54..02c8d7bbb58ca7f46bf1423d3a49394f1bb9baad 100644 (file)
@@ -36,6 +36,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open
 from collections import defaultdict\r
 from .MetaFileTable import MetaFileStorage\r
 from .MetaFileCommentParser import CheckInfComment\r
+from Common.DataType import TAB_COMMENT_EDK_START, TAB_COMMENT_EDK_END\r
 \r
 ## RegEx for finding file versions\r
 hexVersionPattern = re.compile(r'0[xX][\da-f-A-F]{5,8}')\r
@@ -45,7 +46,7 @@ CODEPattern = re.compile(r"{CODE\([a-fA-F0-9Xx\{\},\s]*\)}")
 ## A decorator used to parse macro definition\r
 def ParseMacro(Parser):\r
     def MacroParser(self):\r
-        Match = gMacroDefPattern.match(self._CurrentLine)\r
+        Match = GlobalData.gMacroDefPattern.match(self._CurrentLine)\r
         if not Match:\r
             # Not 'DEFINE/EDK_GLOBAL' statement, call decorated method\r
             Parser(self)\r
@@ -66,7 +67,7 @@ def ParseMacro(Parser):
             EdkLogger.error('Parser', FORMAT_INVALID, "%s can only be defined via environment variable" % Name,\r
                             ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)\r
         # Only upper case letters, digit and '_' are allowed\r
-        if not gMacroNamePattern.match(Name):\r
+        if not GlobalData.gMacroNamePattern.match(Name):\r
             EdkLogger.error('Parser', FORMAT_INVALID, "The macro name must be in the pattern [A-Z][A-Z0-9_]*",\r
                             ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)\r
 \r
@@ -562,10 +563,10 @@ class InfParser(MetaFileParser):
                     SectionComments.extend(Comments)\r
                     Comments = []\r
                 continue\r
-            if Line.find(DataType.TAB_COMMENT_EDK_START) > -1:\r
+            if Line.find(TAB_COMMENT_EDK_START) > -1:\r
                 IsFindBlockComment = True\r
                 continue\r
-            if Line.find(DataType.TAB_COMMENT_EDK_END) > -1:\r
+            if Line.find(TAB_COMMENT_EDK_END) > -1:\r
                 IsFindBlockComment = False\r
                 continue\r
             if IsFindBlockComment:\r