Commit d90a7cff authored by John Zhang's avatar John Zhang

use MuCString as the array constant type

parent e2c4d352
Pipeline #861 failed with stage
in 0 seconds
......@@ -53,12 +53,10 @@ class CArrayConst(object):
self.lst = lst
def __str__(self):
if self.c_elm_t == 'MuCString':
return '({type}){value}'.format(type='char*[%d]' % len(self.lst),
value='{%s}' % ', '.join(map(lambda s: str(CStr(s)), self.lst)))
else:
return '({type}){value}'.format(type='%s [%d]' % (self.c_elm_t, len(self.lst)),
value='{%s}' % ', '.join(map(str, self.lst)))
f = lambda s: str(CStr(s)) if self.c_elm_t == 'MuCString' else str(s)
return '({type}){value}'.format(
type='%s [%d]' % (self.c_elm_t, len(self.lst)),
value='{%s}' % ', '.join(map(f, self.lst)))
__repr__ = __str__
......
......@@ -55,12 +55,10 @@ class CArrayConst(object):
self.lst = lst
def __str__(self):
if self.c_elm_t == 'MuCString':
return '({type}){value}'.format(type='char*[%d]' % len(self.lst),
value='{%s}' % ', '.join(map(lambda s: str(CStr(s)), self.lst)))
else:
return '({type}){value}'.format(type='%s [%d]' % (self.c_elm_t, len(self.lst)),
value='{%s}' % ', '.join(map(str, self.lst)))
f = lambda s: str(CStr(s)) if self.c_elm_t == 'MuCString' else str(s)
return '({type}){value}'.format(
type='%s [%d]' % (self.c_elm_t, len(self.lst)),
value='{%s}' % ', '.join(map(f, self.lst)))
__repr__ = __str__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment