public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser
@ 2017-03-07  6:01 hesschen
  2017-03-07  6:01 ` [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"' hesschen
  2017-03-09  6:52 ` [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser Zhu, Yonghong
  0 siblings, 2 replies; 4+ messages in thread
From: hesschen @ 2017-03-07  6:01 UTC (permalink / raw)
  To: edk2-devel

The original solution of getting parameter name is to skip "_" but
now it doesn't ignore "_" anymore.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: hesschen <hesheng.chen@intel.com>
---
 BaseTools/Source/Python/Ecc/c.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py
index d7b9598..35b7405 100644
--- a/BaseTools/Source/Python/Ecc/c.py
+++ b/BaseTools/Source/Python/Ecc/c.py
@@ -1,7 +1,7 @@
 ## @file
 # This file is used to be the c coding style checking of ECC tool
 #
-# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 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 distribution.  The full text of the license may be found at
@@ -271,7 +271,7 @@ def GetIdentifierList():
 def StripNonAlnumChars(Str):
     StrippedStr = ''
     for Char in Str:
-        if Char.isalnum():
+        if Char.isalnum() or Char == '_':
             StrippedStr += Char
     return StrippedStr
 
-- 
2.7.2.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"'
  2017-03-07  6:01 [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser hesschen
@ 2017-03-07  6:01 ` hesschen
  2017-03-09  6:53   ` Zhu, Yonghong
  2017-03-09  6:52 ` [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser Zhu, Yonghong
  1 sibling, 1 reply; 4+ messages in thread
From: hesschen @ 2017-03-07  6:01 UTC (permalink / raw)
  To: edk2-devel

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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser
  2017-03-07  6:01 [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser hesschen
  2017-03-07  6:01 ` [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"' hesschen
@ 2017-03-09  6:52 ` Zhu, Yonghong
  1 sibling, 0 replies; 4+ messages in thread
From: Zhu, Yonghong @ 2017-03-09  6:52 UTC (permalink / raw)
  To: Chen, Hesheng, edk2-devel@lists.01.org

Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> 

Best Regards,
Zhu Yonghong

-----Original Message-----
From: Chen, Hesheng 
Sent: Tuesday, March 07, 2017 2:02 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong <yonghong.zhu@intel.com>
Subject: [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser

The original solution of getting parameter name is to skip "_" but now it doesn't ignore "_" anymore.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: hesschen <hesheng.chen@intel.com>
---
 BaseTools/Source/Python/Ecc/c.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py
index d7b9598..35b7405 100644
--- a/BaseTools/Source/Python/Ecc/c.py
+++ b/BaseTools/Source/Python/Ecc/c.py
@@ -1,7 +1,7 @@
 ## @file
 # This file is used to be the c coding style checking of ECC tool  # -# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 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 distribution.  The full text of the license may be found at @@ -271,7 +271,7 @@ def GetIdentifierList():
 def StripNonAlnumChars(Str):
     StrippedStr = ''
     for Char in Str:
-        if Char.isalnum():
+        if Char.isalnum() or Char == '_':
             StrippedStr += Char
     return StrippedStr
 
--
2.7.2.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"'
  2017-03-07  6:01 ` [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"' hesschen
@ 2017-03-09  6:53   ` Zhu, Yonghong
  0 siblings, 0 replies; 4+ messages in thread
From: Zhu, Yonghong @ 2017-03-09  6:53 UTC (permalink / raw)
  To: Chen, Hesheng, edk2-devel@lists.01.org

Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

Best Regards,
Zhu Yonghong


-----Original Message-----
From: Chen, Hesheng 
Sent: Tuesday, March 07, 2017 2:02 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong <yonghong.zhu@intel.com>
Subject: [patch 2/2] 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: 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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-09  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-07  6:01 [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser hesschen
2017-03-07  6:01 ` [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"' hesschen
2017-03-09  6:53   ` Zhu, Yonghong
2017-03-09  6:52 ` [patch 1/2] BaseTools/ECC: Fix an issue of parameter parser Zhu, Yonghong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox