Add macro parameter check for GenCfgData.py

This patch added parameter error check for macro passed into the
template.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
Maurice Ma 2020-04-18 09:46:21 -07:00
parent 0b31b6b2a6
commit eb37c1c715
1 changed files with 3 additions and 0 deletions

View File

@ -500,6 +500,9 @@ EndList
Line = self.ExpandMacros(Line, True)
for Idx in range(len(Vars)-1, 0, -1):
Line = Line.replace('$(%d)' % Idx, Vars[Idx].strip())
Remaining = re.findall ('\$\(\d+\)', Line)
if len(Remaining) > 0:
raise Exception ("ERROR: Unknown argument '%s' for template '%s' !" % (Remaining[0], Vars[0]))
return Line
def CfgDuplicationCheck (self, CfgDict, Name):