]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/RangeExpression.py
BaseTools: Various typo
[mirror_edk2.git] / BaseTools / Source / Python / Common / RangeExpression.py
index 20581edadf3f5c9c14a1abe113bd1e309a1d614f..1c52e83792ebbfedc3f3a760335709090b627f2e 100644 (file)
@@ -19,6 +19,7 @@ from CommonDataClass.Exceptions import WrnExpression
 import uuid\r
 from Common.Expression import PcdPattern, BaseExpression\r
 from Common.DataType import *\r
+from re import compile\r
 \r
 ERR_STRING_EXPR = 'This operator cannot be used in string expression: [%s].'\r
 ERR_SNYTAX = 'Syntax error, the rest of expression cannot be evaluated: [%s].'\r
@@ -26,7 +27,7 @@ ERR_MATCH = 'No matching right parenthesis.'
 ERR_STRING_TOKEN = 'Bad string token: [%s].'\r
 ERR_MACRO_TOKEN = 'Bad macro token: [%s].'\r
 ERR_EMPTY_TOKEN = 'Empty token is not allowed.'\r
-ERR_PCD_RESOLVE = 'PCD token cannot be resolved: [%s].'\r
+ERR_PCD_RESOLVE = 'The PCD should be FeatureFlag type or FixedAtBuild type: [%s].'\r
 ERR_VALID_TOKEN = 'No more valid token found from rest of string: [%s].'\r
 ERR_EXPR_TYPE = 'Different types found in expression.'\r
 ERR_OPERATOR_UNSUPPORT = 'Unsupported operator: [%s]'\r
@@ -202,7 +203,7 @@ class RangeExpression(BaseExpression):
 \r
     NonLetterOpLst = ['+', '-', '&', '|', '^', '!', '=', '>', '<']\r
 \r
-    RangePattern = re.compile(r'[0-9]+ - [0-9]+')\r
+    RangePattern = compile(r'[0-9]+ - [0-9]+')\r
 \r
     def preProcessRangeExpr(self, expr):\r
         # convert hex to int\r
@@ -289,7 +290,7 @@ class RangeExpression(BaseExpression):
         return rangeid\r
 \r
 \r
-    def NegtiveRange(self, Oprand1):\r
+    def NegativeRange(self, Oprand1):\r
         rangeContainer1 = self.operanddict[Oprand1]\r
 \r
 \r
@@ -331,7 +332,7 @@ class RangeExpression(BaseExpression):
         if Operator in ["!", "NOT", "not"]:\r
             if not gGuidPattern.match(Oprand1.strip()):\r
                 raise BadExpression(ERR_STRING_EXPR % Operator)\r
-            return self.NegtiveRange(Oprand1)\r
+            return self.NegativeRange(Oprand1)\r
         else:\r
             if Operator in ["==", ">=", "<=", ">", "<", '^']:\r
                 return self.EvalRange(Operator, Oprand1)\r