From: Yunhua Feng Date: Fri, 8 Jun 2018 08:46:48 +0000 (+0800) Subject: BaseTools: Fix one bug of nest !include parser X-Git-Tag: edk2-stable201903~1602 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=46e4b3940e2f1862aa605900616a543a43f17222;ds=sidebyside BaseTools: Fix one bug of nest !include parser The case is DSC file include file1, file1 include file2, after parse file2 finished, DSC parser get the wrong section type, then it would report invalid error. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu Tested-by: Michael D Kinney --- diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index b1e715d5d4..a2ded0c845 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1581,7 +1581,11 @@ class DscParser(MetaFileParser): # update current status with sub-parser's status self._SectionName = Parser._SectionName - self._SectionType = Parser._SectionType + if not self._InSubsection: + self._SectionType = Parser._SectionType + self._SubsectionType = Parser._SubsectionType + self._InSubsection = Parser._InSubsection + self._Scope = Parser._Scope self._Enabled = Parser._Enabled