X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FExpression.py;h=462e8f93f883e3d765ccf4fefac02ff1e849bd6b;hp=320f0015009b3c28e16562cda31116b179597e8d;hb=1563349a967d7e02c43492ba853babb9c660a083;hpb=0a014fba41b631258687f56e630518b54817d062 diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py index 320f001500..462e8f93f8 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -43,6 +43,7 @@ ERR_IN_OPERAND = 'Macro after IN operator can only be: $(FAMILY), $(ARC __ValidString = re.compile(r'[_a-zA-Z][_0-9a-zA-Z]*$') _ReLabel = re.compile('LABEL\((\w+)\)') _ReOffset = re.compile('OFFSET_OF\((\w+)\)') +PcdPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*\.[_a-zA-Z][0-9A-Za-z_]*$') ## SplitString # Split string to list according double quote @@ -214,7 +215,6 @@ class ValueExpression(object): NonLetterOpLst = ['+', '-', '*', '/', '%', '&', '|', '^', '~', '<<', '>>', '!', '=', '>', '<', '?', ':'] - PcdPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*\.[_a-zA-Z][0-9A-Za-z_]*$') SymbolPattern = re.compile("(" "\$\([A-Z][A-Z0-9_]*\)|\$\(\w+\.\w+\)|\w+\.\w+|" @@ -616,7 +616,7 @@ class ValueExpression(object): raise BadExpression(ERR_EMPTY_TOKEN) # PCD token - if self.PcdPattern.match(self._Token): + if PcdPattern.match(self._Token): if self._Token not in self._Symb: Ex = BadExpression(ERR_PCD_RESOLVE % self._Token) Ex.Pcd = self._Token