Re: [edk2] [Patch] BaseTools: Report more clear error message for PCD used in expression

2018-09-04 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yonghong 
Zhu
Sent: Tuesday, September 04, 2018 3:16 PM
To: edk2-devel@lists.01.org
Cc: Gao, Liming 
Subject: [edk2] [Patch] BaseTools: Report more clear error message for PCD used 
in expression

From: zhijufan 

Only the FeatureFlag type or FixedAtBuild type can be used in the expression.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan 
---
 BaseTools/Source/Python/Common/Expression.py  | 2 +-
 BaseTools/Source/Python/Common/RangeExpression.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py 
b/BaseTools/Source/Python/Common/Expression.py
index 78c69fa..ff92710 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -27,11 +27,11 @@ ERR_STRING_EXPR = 'This operator cannot be used in 
string expression: [%
 ERR_SNYTAX  = 'Syntax error, the rest of expression cannot be 
evaluated: [%s].'
 ERR_MATCH   = 'No matching right parenthesis.'
 ERR_STRING_TOKEN= 'Bad string token: [%s].'
 ERR_MACRO_TOKEN = 'Bad macro token: [%s].'
 ERR_EMPTY_TOKEN = 'Empty token is not allowed.'
-ERR_PCD_RESOLVE = 'PCD token cannot be resolved: [%s].'
+ERR_PCD_RESOLVE = 'The PCD should be FeatureFlag type or FixedAtBuild 
type: [%s].'
 ERR_VALID_TOKEN = 'No more valid token found from rest of string: 
[%s].'
 ERR_EXPR_TYPE   = 'Different types found in expression.'
 ERR_OPERATOR_UNSUPPORT  = 'Unsupported operator: [%s]'
 ERR_REL_NOT_IN  = 'Expect "IN" after "not" operator.'
 WRN_BOOL_EXPR   = 'Operand of boolean type cannot be used in 
arithmetic expression.'
diff --git a/BaseTools/Source/Python/Common/RangeExpression.py 
b/BaseTools/Source/Python/Common/RangeExpression.py
index 20581ed..407dc06 100644
--- a/BaseTools/Source/Python/Common/RangeExpression.py
+++ b/BaseTools/Source/Python/Common/RangeExpression.py
@@ -24,11 +24,11 @@ ERR_STRING_EXPR = 'This operator cannot be used in string 
expression: [%s].'
 ERR_SNYTAX = 'Syntax error, the rest of expression cannot be evaluated: [%s].'
 ERR_MATCH = 'No matching right parenthesis.'
 ERR_STRING_TOKEN = 'Bad string token: [%s].'
 ERR_MACRO_TOKEN = 'Bad macro token: [%s].'
 ERR_EMPTY_TOKEN = 'Empty token is not allowed.'
-ERR_PCD_RESOLVE = 'PCD token cannot be resolved: [%s].'
+ERR_PCD_RESOLVE = 'The PCD should be FeatureFlag type or FixedAtBuild type: 
[%s].'
 ERR_VALID_TOKEN = 'No more valid token found from rest of string: [%s].'
 ERR_EXPR_TYPE = 'Different types found in expression.'
 ERR_OPERATOR_UNSUPPORT = 'Unsupported operator: [%s]'
 ERR_REL_NOT_IN = 'Expect "IN" after "not" operator.'
 WRN_BOOL_EXPR = 'Operand of boolean type cannot be used in arithmetic 
expression.'
--
2.6.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] BaseTools: Report more clear error message for PCD used in expression

2018-09-04 Thread Yonghong Zhu
From: zhijufan 

Only the FeatureFlag type or FixedAtBuild type can be used in the
expression.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan 
---
 BaseTools/Source/Python/Common/Expression.py  | 2 +-
 BaseTools/Source/Python/Common/RangeExpression.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py 
b/BaseTools/Source/Python/Common/Expression.py
index 78c69fa..ff92710 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -27,11 +27,11 @@ ERR_STRING_EXPR = 'This operator cannot be used in 
string expression: [%
 ERR_SNYTAX  = 'Syntax error, the rest of expression cannot be 
evaluated: [%s].'
 ERR_MATCH   = 'No matching right parenthesis.'
 ERR_STRING_TOKEN= 'Bad string token: [%s].'
 ERR_MACRO_TOKEN = 'Bad macro token: [%s].'
 ERR_EMPTY_TOKEN = 'Empty token is not allowed.'
-ERR_PCD_RESOLVE = 'PCD token cannot be resolved: [%s].'
+ERR_PCD_RESOLVE = 'The PCD should be FeatureFlag type or FixedAtBuild 
type: [%s].'
 ERR_VALID_TOKEN = 'No more valid token found from rest of string: 
[%s].'
 ERR_EXPR_TYPE   = 'Different types found in expression.'
 ERR_OPERATOR_UNSUPPORT  = 'Unsupported operator: [%s]'
 ERR_REL_NOT_IN  = 'Expect "IN" after "not" operator.'
 WRN_BOOL_EXPR   = 'Operand of boolean type cannot be used in 
arithmetic expression.'
diff --git a/BaseTools/Source/Python/Common/RangeExpression.py 
b/BaseTools/Source/Python/Common/RangeExpression.py
index 20581ed..407dc06 100644
--- a/BaseTools/Source/Python/Common/RangeExpression.py
+++ b/BaseTools/Source/Python/Common/RangeExpression.py
@@ -24,11 +24,11 @@ ERR_STRING_EXPR = 'This operator cannot be used in string 
expression: [%s].'
 ERR_SNYTAX = 'Syntax error, the rest of expression cannot be evaluated: [%s].'
 ERR_MATCH = 'No matching right parenthesis.'
 ERR_STRING_TOKEN = 'Bad string token: [%s].'
 ERR_MACRO_TOKEN = 'Bad macro token: [%s].'
 ERR_EMPTY_TOKEN = 'Empty token is not allowed.'
-ERR_PCD_RESOLVE = 'PCD token cannot be resolved: [%s].'
+ERR_PCD_RESOLVE = 'The PCD should be FeatureFlag type or FixedAtBuild type: 
[%s].'
 ERR_VALID_TOKEN = 'No more valid token found from rest of string: [%s].'
 ERR_EXPR_TYPE = 'Different types found in expression.'
 ERR_OPERATOR_UNSUPPORT = 'Unsupported operator: [%s]'
 ERR_REL_NOT_IN = 'Expect "IN" after "not" operator.'
 WRN_BOOL_EXPR = 'Operand of boolean type cannot be used in arithmetic 
expression.'
-- 
2.6.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel