summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2014-08-25 01:16:34 +0000
committerhchen30 <hchen30@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-25 01:16:34 +0000
commitb3d07ff8d21ecab5a8060815e9abe73c904e3ed9 (patch)
treeecc756e5c8173a9d9aa82beb43fc526e19608066 /BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
parentf056e4c18047e9a0157a915175d07afbd8b8c581 (diff)
downloadedk2-b3d07ff8d21ecab5a8060815e9abe73c904e3ed9.tar.gz
edk2-b3d07ff8d21ecab5a8060815e9abe73c904e3ed9.tar.bz2
edk2-b3d07ff8d21ecab5a8060815e9abe73c904e3ed9.zip
This patch is going to:
1. Add a checkpoint to check if an UNI file is a valid UTF-16 file 2. Add a checkpoint to check if a GUID/PPI/PROTOCOL/PCD is in a valid format. 3. Some other minor changes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15886 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py')
-rw-r--r--BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
index 949d067945..1c3e968785 100644
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
@@ -433,6 +433,7 @@ class InfParser(MetaFileParser):
def Start(self):
NmakeLine = ''
Content = ''
+ Usage = ''
try:
Content = open(str(self.MetaFile), 'r').readlines()
except:
@@ -451,8 +452,26 @@ class InfParser(MetaFileParser):
IsFindBlockComment = False
for Index in range(0, len(Content)):
+ if self._SectionType in [MODEL_EFI_GUID,
+ MODEL_EFI_PROTOCOL,
+ MODEL_EFI_PPI,
+ MODEL_PCD_FIXED_AT_BUILD,
+ MODEL_PCD_PATCHABLE_IN_MODULE,
+ MODEL_PCD_FEATURE_FLAG,
+ MODEL_PCD_DYNAMIC_EX,
+ MODEL_PCD_DYNAMIC]:
+ Line = Content[Index].strip()
+ if Line.startswith(TAB_COMMENT_SPLIT):
+ continue
+ elif Line.find(TAB_COMMENT_SPLIT) > 0:
+ Usage = Line[Line.find(TAB_COMMENT_SPLIT):]
+ Line = Line[:Line.find(TAB_COMMENT_SPLIT)]
+ else:
+ Usage = ''
+ else:
# skip empty, commented, block commented lines
- Line = CleanString(Content[Index], AllowCppStyleComment=True)
+ Line = CleanString(Content[Index], AllowCppStyleComment=True)
+ Usage = ''
NextLine = ''
if Index + 1 < len(Content):
NextLine = CleanString(Content[Index + 1])
@@ -539,7 +558,8 @@ class InfParser(MetaFileParser):
-1,
self._LineIndex+1,
-1,
- 0
+ 0,
+ Usage
)
if IsFindBlockComment:
EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments (starting with /*) are expected to end with */",