diff options
author | Hess Chen <hesheng.chen@intel.com> | 2017-03-07 14:01:34 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-03-09 15:05:24 +0800 |
commit | 85ea493fb78f988eabaa68c16ba5c95f498e5eff (patch) | |
tree | feca5dbb250a17e9f2fddb23011773b4d934df02 | |
parent | b7f63a5a53a77bc48b81e7ddad511349addff421 (diff) | |
download | edk2-85ea493fb78f988eabaa68c16ba5c95f498e5eff.zip edk2-85ea493fb78f988eabaa68c16ba5c95f498e5eff.tar.gz edk2-85ea493fb78f988eabaa68c16ba5c95f498e5eff.tar.bz2 |
BaseTools/UPT: Add a checkpoint for missing '"'
Add a checkpoint for UNI file which is missing '"' at the end of a line.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
-rw-r--r-- | BaseTools/Source/Python/UPT/Library/UniClassObject.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTools/Source/Python/UPT/Library/UniClassObject.py index 27804cc..1fbbf2e 100644 --- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py +++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py @@ -1,7 +1,7 @@ ## @file
# Collect all defined strings in multiple uni files.
#
-# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -558,7 +558,16 @@ class UniFileClassObject(object): Message="Cannot find include file",
ExtraData=str(IncList[0]))
continue
-
+
+ #
+ # Check if single line has correct '"'
+ #
+ if Line.startswith(u'#string') and Line.find(u'#language') > -1 and Line.find('"') > Line.find(u'#language'):
+ if not Line.endswith('"'):
+ EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
+ ExtraData='''The line %s misses '"' at the end of it in file %s'''
+ % (LineCount, File.Path))
+
#
# Between Name entry and Language entry can not contain line feed
#
|