Simplify token processing in c_preproc

This commit is contained in:
Thomas Nagy 2017-04-22 22:30:34 +02:00
parent ae3d3c6b93
commit 712fdf7765
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
1 changed files with 7 additions and 10 deletions

View File

@ -747,17 +747,14 @@ def tokenize_private(s):
v = m(name)
if v:
if name == IDENT:
try:
g_optrans[v]
if v in g_optrans:
name = OP
except KeyError:
# c++ specific
if v.lower() == "true":
v = 1
name = NUM
elif v.lower() == "false":
v = 0
name = NUM
elif v.lower() == "true":
v = 1
name = NUM
elif v.lower() == "false":
v = 0
name = NUM
elif name == NUM:
if m('oct'):
v = int(v, 8)