# Path: luna/objects.py
# class LuaValue(object):
# class LBoolean(LuaValue):
# class LNil(LuaValue):
# class LNumber(LuaValue):
# class LString(LuaValue):
# class LVar(LuaValue):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __iter__(self):
#     def __repr__(self):
#     def __init__(self, value):
#     def __hash__(self):
#     def __init__(self, value):
#     def __hash__(self):
#     def __init__(self, value):
#     def __hash__(self):
#     def __init__(self, value):
#     def __hash__(self):
# 
# Path: luna/stdlib/builtin.py
# def lua_print(luavalue):
# 
# Path: luna/vm/opcodes.py
# class OpCode(object):
# class BinaryAdd(OpCode):
# class BinarySubtract(OpCode):
# class Call(OpCode):
# class LoadConst(OpCode):
# class LoadName(OpCode):
# class PopBlock(OpCode):
# class SetupDo(OpCode):
# class StoreName(OpCode):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __iter__(self):
#     def __repr__(self):
#     def __init__(self, index):
#     def __init__(self, index):
#     def __init__(self, index):


from luna import objects as obj
from luna.stdlib import builtin
from luna.vm import opcodes as ops
    def run(self):
        while self.pc < len(self.code):
            op = self.code[self.pc]

            if type(op) == ops.BinaryAdd:
                x = self.stack.pop()
                y = self.stack.pop()
                v = obj.LNumber(y.value + x.value)
                self.stack.append(v)

            elif type(op) == ops.BinarySubtract:
                x = self.stack.pop()
                y = self.stack.pop()
                v = obj.LNumber(y.value - x.value)
                self.stack.append(v)

            elif type(op) == ops.Call:
                func = self.stack.pop()
                arg = self.stack.pop()
                if type(arg) == obj.LVar:
                    arg = self.env[arg]
                func(arg)

            elif type(op) == ops.LoadConst:
                self.stack.append(self.consts[op.index])

            elif type(op) == ops.LoadName:
                lvar = self.vars[op.index]
                value = self.env.get(lvar)
                if value is None:

# Path: luna/objects.py
# class LuaValue(object):
# class LBoolean(LuaValue):
# class LNil(LuaValue):
# class LNumber(LuaValue):
# class LString(LuaValue):
# class LVar(LuaValue):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __iter__(self):
#     def __repr__(self):
#     def __init__(self, value):
#     def __hash__(self):
#     def __init__(self, value):
#     def __hash__(self):
#     def __init__(self, value):
#     def __hash__(self):
#     def __init__(self, value):
#     def __hash__(self):
# 
# Path: luna/stdlib/builtin.py
# def lua_print(luavalue):
# 
# Path: luna/vm/opcodes.py
# class OpCode(object):
# class BinaryAdd(OpCode):
# class BinarySubtract(OpCode):
# class Call(OpCode):
# class LoadConst(OpCode):
# class LoadName(OpCode):
# class PopBlock(OpCode):
# class SetupDo(OpCode):
# class StoreName(OpCode):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __iter__(self):
#     def __repr__(self):
#     def __init__(self, index):
#     def __init__(self, index):
#     def __init__(self, index):


# Path: luna/vm/frame.py
from luna import objects as obj
from luna.stdlib import builtin
from luna.vm import opcodes as ops

    def run(self):
        while self.pc < len(self.code):
            op = self.code[self.pc]

            if type(op) == ops.BinaryAdd:
                x = self.stack.pop()
                y = self.stack.pop()
                v = obj.LNumber(y.value + x.value)
                self.stack.append(v)

            elif type(op) == ops.BinarySubtract:
                x = self.stack.pop()
                y = self.stack.pop()
                v = obj.LNumber(y.value - x.value)
                self.stack.append(v)

            elif type(op) == ops.Call:
                func = self.stack.pop()
                arg = self.stack.pop()
                if type(arg) == obj.LVar:
                    arg = self.env[arg]
                func(arg)

            elif type(op) == ops.LoadConst:
                self.stack.append(self.consts[op.index])

            elif type(op) == ops.LoadName:
                lvar = self.vars[op.index]
                value = self.env.get(lvar)
                if value is None:

                    value = getattr(builtin, 'lua_' + lvar.value)