X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FIdfClassObject.py;h=a028aceee927af6d2a4edf040e44d96864817351;hp=cb72219b40d5b19f7f01784726730bde99f327c9;hb=1f26f5fdb96b4a0010c4388273fc42d551170dd6;hpb=7da06eeede10fc8b908327b375bcdf36707ff7b5 diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py b/BaseTools/Source/Python/AutoGen/IdfClassObject.py index cb72219b40..a028aceee9 100644 --- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py +++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py @@ -21,6 +21,7 @@ from Common.Misc import PathClass from Common.LongFilePathSupport import LongFilePath import re import os +from Common.GlobalData import gIdentifierPattern IMAGE_TOKEN = re.compile('IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE) @@ -105,7 +106,7 @@ class IdfFileClassObject(object): EdkLogger.error("Image Definition File Parser", PARSER_ERROR, 'The format is not match #image IMAGE_ID [TRANSPARENT] ImageFileName in Line %s of File %s.' % (LineNo, File.Path)) if Len == 4 and LineDetails[2] != 'TRANSPARENT': EdkLogger.error("Image Definition File Parser", PARSER_ERROR, 'Please use the keyword "TRANSPARENT" to describe the transparency setting in Line %s of File %s.' % (LineNo, File.Path)) - MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', LineDetails[1], re.UNICODE) + MatchString = gIdentifierPattern.match(LineDetails[1]) if MatchString is None or MatchString.end(0) != len(LineDetails[1]): EdkLogger.error('Image Definition File Parser', FORMAT_INVALID, 'The Image token name %s defined in Idf file %s contains the invalid character.' % (LineDetails[1], File.Path)) if LineDetails[1] not in self.ImageIDList: