summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/UniClassObject.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-08-02 17:21:34 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-08-08 10:52:31 +0800
commitc3915fa586c98ec68da3b464218651480e1324b6 (patch)
treeabac2c6cfcb78dcec9f29c7817a4121576214d39 /BaseTools/Source/Python/AutoGen/UniClassObject.py
parent7e9cf612056ed2667eaad7f0e901f0a37f6ddd5b (diff)
downloadedk2-c3915fa586c98ec68da3b464218651480e1324b6.tar.gz
edk2-c3915fa586c98ec68da3b464218651480e1324b6.tar.bz2
edk2-c3915fa586c98ec68da3b464218651480e1324b6.zip
BaseTools: Allow string token identifier to use lower case letters
This patch is to align the code behavior with UNI spec that string token identifier can use upper case and lower case letters. Cc: Liming Gao <liming.gao@intel.com> Cc: Felix <Felixp@ami.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/UniClassObject.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/UniClassObject.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py
index 183b2b2337..856d19cda2 100644
--- a/BaseTools/Source/Python/AutoGen/UniClassObject.py
+++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py
@@ -348,11 +348,11 @@ class UniFileClassObject(object):
Value = ''
Name = Item.split()[1]
- # Check the string name is the upper character
+ # Check the string name
if Name != '':
- MatchString = re.match('[A-Z0-9_]+', Name, re.UNICODE)
+ MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', Name, re.UNICODE)
if MatchString == 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 lower case character.' % (Name, self.File))
+ 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 ')
for IndexI in range(len(LanguageList)):
if IndexI == 0:
@@ -518,11 +518,11 @@ class UniFileClassObject(object):
break
# Value = Value.replace(u'\r\n', u'')
Language = GetLanguageCode(Language, self.IsCompatibleMode, self.File)
- # Check the string name is the upper character
+ # Check the string name
if not self.IsCompatibleMode and Name != '':
- MatchString = re.match('[A-Z0-9_]+', Name, re.UNICODE)
+ MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', Name, re.UNICODE)
if MatchString == 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 lower case character.' % (Name, self.File))
+ 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)
continue