* [Patch] BaseTools: Extend the keyword "!include"/"!if" to case-insensitive
@ 2018-09-04 2:37 Yonghong Zhu
2018-09-04 6:14 ` Zhu, Yonghong
0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-09-04 2:37 UTC (permalink / raw)
To: edk2-devel; +Cc: zhijufan, Liming Gao
From: zhijufan <zhijux.fan@intel.com>
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.
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>
---
BaseTools/Source/Python/GenFds/FdfParser.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 8de0b48..7e1be65 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -1111,10 +1111,12 @@ class FdfParser:
EndPos = self.CurrentOffsetWithinLine
if self.CurrentLineNumber != StartLine:
EndPos = len(self.Profile.FileLinesList[StartLine-1])
self.__Token = self.Profile.FileLinesList[StartLine-1][StartPos : EndPos]
+ 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]:
+ self.__Token = self.__Token.lower()
if StartPos != self.CurrentOffsetWithinLine:
return True
else:
return False
--
2.6.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] BaseTools: Extend the keyword "!include"/"!if" to case-insensitive
2018-09-04 2:37 [Patch] BaseTools: Extend the keyword "!include"/"!if" to case-insensitive Yonghong Zhu
@ 2018-09-04 6:14 ` Zhu, Yonghong
0 siblings, 0 replies; 2+ messages in thread
From: Zhu, Yonghong @ 2018-09-04 6:14 UTC (permalink / raw)
To: Zhu, Yonghong, edk2-devel@lists.01.org; +Cc: Gao, Liming, Zhu, Yonghong
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Best Regards,
Zhu Yonghong
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yonghong Zhu
Sent: Tuesday, September 04, 2018 10:38 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [Patch] BaseTools: Extend the keyword "!include"/"!if" to case-insensitive
From: zhijufan <zhijux.fan@intel.com>
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.
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>
---
BaseTools/Source/Python/GenFds/FdfParser.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 8de0b48..7e1be65 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -1111,10 +1111,12 @@ class FdfParser:
EndPos = self.CurrentOffsetWithinLine
if self.CurrentLineNumber != StartLine:
EndPos = len(self.Profile.FileLinesList[StartLine-1])
self.__Token = self.Profile.FileLinesList[StartLine-1][StartPos : EndPos]
+ 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]:
+ self.__Token = self.__Token.lower()
if StartPos != self.CurrentOffsetWithinLine:
return True
else:
return False
--
2.6.1.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-04 6:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-04 2:37 [Patch] BaseTools: Extend the keyword "!include"/"!if" to case-insensitive Yonghong Zhu
2018-09-04 6:14 ` Zhu, Yonghong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox