BaseTools: create and use a standard shared variable for '*'

add a variable for the string '*' and then use it instead of lots of '*'

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by : Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Jaben Carsey
2018-11-16 23:40:04 +08:00
committed by BobCF
parent ea55e37c36
commit bc39c5cbea
13 changed files with 70 additions and 69 deletions

View File

@ -64,7 +64,6 @@ T_CHAR_CR = '\r'
T_CHAR_TAB = '\t'
T_CHAR_DOUBLE_QUOTE = '\"'
T_CHAR_SINGLE_QUOTE = '\''
T_CHAR_STAR = '*'
T_CHAR_BRACE_R = '}'
SEPARATORS = {TAB_EQUAL_SPLIT, TAB_VALUE_SPLIT, TAB_COMMA_SPLIT, '{', T_CHAR_BRACE_R}
@ -533,7 +532,7 @@ class FdfParser:
InComment = False
HashComment = False
# check for */ comment end
elif InComment and not DoubleSlashComment and not HashComment and self._CurrentChar() == T_CHAR_STAR and self._NextChar() == TAB_BACK_SLASH:
elif InComment and not DoubleSlashComment and not HashComment and self._CurrentChar() == TAB_STAR and self._NextChar() == TAB_BACK_SLASH:
self._SetCurrentCharValue(TAB_SPACE_SPLIT)
self._GetOneChar()
self._SetCurrentCharValue(TAB_SPACE_SPLIT)
@ -552,7 +551,7 @@ class FdfParser:
InComment = True
HashComment = True
# check for /* comment start
elif self._CurrentChar() == TAB_BACK_SLASH and self._NextChar() == T_CHAR_STAR:
elif self._CurrentChar() == TAB_BACK_SLASH and self._NextChar() == TAB_STAR:
self._SetCurrentCharValue(TAB_SPACE_SPLIT)
self._GetOneChar()
self._SetCurrentCharValue(TAB_SPACE_SPLIT)