diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-04-04 06:34:05 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-04-08 15:34:11 +0800 |
commit | 1f26f5fdb96b4a0010c4388273fc42d551170dd6 (patch) | |
tree | db88f4e94ce9899d54816fef0fcfabc34dc4f4a6 /BaseTools/Source/Python/AutoGen/UniClassObject.py | |
parent | 7da06eeede10fc8b908327b375bcdf36707ff7b5 (diff) | |
download | edk2-1f26f5fdb96b4a0010c4388273fc42d551170dd6.tar.gz edk2-1f26f5fdb96b4a0010c4388273fc42d551170dd6.tar.bz2 edk2-1f26f5fdb96b4a0010c4388273fc42d551170dd6.zip |
BaseTools: AutoGen - use the new shared RegEx
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/UniClassObject.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/UniClassObject.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py index 242402dfae..8b0c563a8c 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -351,7 +351,7 @@ class UniFileClassObject(object): Name = Item.split()[1]
# Check the string name
if Name != '':
- MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', Name, re.UNICODE)
+ MatchString = gIdentifierPattern.match(Name)
if MatchString is None or MatchString.end(0) != len(Name):
EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File))
LanguageList = Item.split(u'#language ')
@@ -521,7 +521,7 @@ class UniFileClassObject(object): Language = GetLanguageCode(Language, self.IsCompatibleMode, self.File)
# Check the string name
if not self.IsCompatibleMode and Name != '':
- MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', Name, re.UNICODE)
+ MatchString = gIdentifierPattern.match(Name)
if MatchString is None or MatchString.end(0) != len(Name):
EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File))
self.AddStringToList(Name, Language, Value)
|