public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: hesschen <hesheng.chen@intel.com>
To: edk2-devel@lists.01.org
Subject: [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"'
Date: Tue,  7 Mar 2017 14:01:34 +0800	[thread overview]
Message-ID: <1488866494-10988-2-git-send-email-hesheng.chen@intel.com> (raw)
In-Reply-To: <1488866494-10988-1-git-send-email-hesheng.chen@intel.com>

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: hesschen <hesheng.chen@intel.com>
---
 BaseTools/Source/Python/UPT/Library/UniClassObject.py | 13 +++++++++++--
 1 file 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
             #
-- 
2.7.2.windows.1



  reply	other threads:[~2017-03-07  6:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07  6:01 [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser hesschen
2017-03-07  6:01 ` hesschen [this message]
2017-03-09  6:53   ` [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"' Zhu, Yonghong
2017-03-09  6:52 ` [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser Zhu, Yonghong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488866494-10988-2-git-send-email-hesheng.chen@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox