]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Extend the keyword "!include"/"!if" to case-insensitive
authorzhijufan <zhijux.fan@intel.com>
Tue, 4 Sep 2018 02:28:11 +0000 (10:28 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 5 Sep 2018 01:04:13 +0000 (09:04 +0800)
Extend the keyword "!include", "!if", etc to case-insensitive.
Current DSC parser already support it, while FDF parser only support
the lower case, so this patch add the support for FDF parser.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1111
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/GenFds/FdfParser.py

index 8de0b48ff6feabe2f6e3b0c500bfb5530c0ac8b2..7e1be659fca5c7db99c1a6c74e94aa79c1516f74 100644 (file)
@@ -1113,6 +1113,8 @@ class FdfParser:
         if self.CurrentLineNumber != StartLine:\r
             EndPos = len(self.Profile.FileLinesList[StartLine-1])\r
         self.__Token = self.Profile.FileLinesList[StartLine-1][StartPos : EndPos]\r
+        if self.__Token.lower() in [TAB_IF, TAB_END_IF, TAB_ELSE_IF, TAB_ELSE, TAB_IF_DEF, TAB_IF_N_DEF, TAB_ERROR, TAB_INCLUDE]:\r
+            self.__Token = self.__Token.lower()\r
         if StartPos != self.CurrentOffsetWithinLine:\r
             return True\r
         else:\r