|
|
@ -46,6 +46,8 @@ def execute(program): |
|
|
|
return ("number", item) |
|
|
|
return ("number", item) |
|
|
|
elif type(item) == type(""): |
|
|
|
elif type(item) == type(""): |
|
|
|
return ("string", item) |
|
|
|
return ("string", item) |
|
|
|
|
|
|
|
elif type(item) == type([]): |
|
|
|
|
|
|
|
return list(map(lambda a: _box(a), item)) |
|
|
|
else: |
|
|
|
else: |
|
|
|
return ("identifier", item) |
|
|
|
return ("identifier", item) |
|
|
|
if type(ctx) == type([]) and ctx[0][0] == "identifier": |
|
|
|
if type(ctx) == type([]) and ctx[0][0] == "identifier": |
|
|
@ -98,8 +100,6 @@ def execute(program): |
|
|
|
return ret |
|
|
|
return ret |
|
|
|
elif ctx[0] == _ident("at"): |
|
|
|
elif ctx[0] == _ident("at"): |
|
|
|
return subs[2][int(subs[1][1])] |
|
|
|
return subs[2][int(subs[1][1])] |
|
|
|
elif ctx[0] == _ident("length"): |
|
|
|
|
|
|
|
return _box(len(subs[1])) |
|
|
|
|
|
|
|
elif ctx[0] in funcspace: |
|
|
|
elif ctx[0] in funcspace: |
|
|
|
#print(subs) |
|
|
|
#print(subs) |
|
|
|
prototype = funcspace[ctx[0]] |
|
|
|
prototype = funcspace[ctx[0]] |
|
|
|