Added conditional statement support for !INCLUDE directive
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 3 Apr 2008 03:21:42 +0000 (03:21 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 3 Apr 2008 03:21:42 +0000 (03:21 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1114 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Workspace/MetaFileParser.py

index 715082d..c7b93c3 100644 (file)
@@ -412,6 +412,7 @@ class DscParser(MetaFileParser):
             Parser._SectionName = self._SectionName\r
             Parser._SectionType = self._SectionType\r
             Parser._Scope = self._Scope\r
+            Parser._Enabled = self._Enabled\r
             try:\r
                 Parser.Start()\r
             except:\r
@@ -420,6 +421,7 @@ class DscParser(MetaFileParser):
             self._SectionName = Parser._SectionName\r
             self._SectionType = Parser._SectionType\r
             self._Scope       = Parser._Scope\r
+            self._Enabled     = Parser._Enabled\r
         else:\r
             if DirectiveName in ["!IF", "!IFDEF", "!IFNDEF"]:\r
                 # evaluate the expression\r
@@ -436,7 +438,7 @@ class DscParser(MetaFileParser):
                 if len(self._Eval) > 0:\r
                     self._Eval.pop()\r
                 else:\r
-                    EdkLogger.error("DscParser", FORMAT_INVALID, "!if..[!else]..!endif doesn't match",\r
+                    EdkLogger.error("DscParser", FORMAT_INVALID, "!IF..[!ELSE]..!ENDIF doesn't match",\r
                                     File=self._FilePath, Line=self._LineIndex+1)\r
             if self._Eval.Result == False:\r
                 self._Enabled = 0 - len(self._Eval)\r