summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Workspace/MetaFileParser.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py')
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileParser.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index e3f0e6334c..0185240bca 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1087,6 +1087,14 @@ class DscParser(MetaFileParser):
File=self.MetaFile, Line=self._LineIndex + 1,
ExtraData=self._CurrentLine)
+ if DirectiveName in ['!ELSE', '!ENDIF'] and self._ValueList[1] != '':
+ Message = "Unexpected content after '%s'" % self._ValueList[0]
+ if DirectiveName == '!ELSE' and self._ValueList[1].split()[0].lower() == 'if':
+ Message += "; use '!elseif <expression>' for a conditional branch"
+ EdkLogger.error("Parser", FORMAT_INVALID, Message,
+ File=self.MetaFile, Line=self._LineIndex + 1,
+ ExtraData=self._CurrentLine)
+
ItemType = self.DataType[DirectiveName]
Scope = [[TAB_COMMON, TAB_COMMON, TAB_COMMON]]
if ItemType == MODEL_META_DATA_INCLUDE: