Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error lupa.lua54.LuaSyntaxError: #260

Open
ghost opened this issue Mar 8, 2024 · 0 comments
Open

error lupa.lua54.LuaSyntaxError: #260

ghost opened this issue Mar 8, 2024 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 8, 2024

C:\Users\Ирбис>python ide.py
Version Lua(5.3 or 5.4):
Sorry, by default Lua 5.4
Using Lua 5.4 (compiled with (5, 4))
All commands:

  1. console - terminal lua
  2. run - run code
  3. exit - exit runner Lua
>>>console
>>>function a()
Traceback (most recent call last):
  File "C:\Users\Ирбис\ide.py", line 30, in <module>
    console()
  File "C:\Users\Ирбис\ide.py", line 7, in console
    lua_copy = lua.eval(console_input)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "lupa\lua54.pyx", line 404, in lupa.lua54.LuaRuntime.eval
  File "lupa\lua54.pyx", line 1735, in lupa.lua54.run_lua
lupa.lua54.LuaSyntaxError: error loading code: [string "<python>"]:1: '(' expected near 'a'
def console():
    from lupa import LuaRuntime
    lua = LuaRuntime(unpack_returned_tuples=True)
    while True:
        console_input = input('>>>')
        lua_copy = lua.eval(console_input)

def run():
    from lupa import LuaRuntime
    file = input('Directory file: ')
    f = open(file, 'r')
    code = f.read()
    lua = LuaRuntime(unpack_returned_tuples=True)
    lua_func = lua.eval(code)

version = input('Version Lua(5.3 or 5.4): ')
if version == '5.3':
    import lupa.lua53 as lupa
elif version == '5.4':
    import lupa.lua54 as lupa
else:
    print('Sorry, by default Lua 5.4')
    import lupa
print(f"Using {lupa.LuaRuntime().lua_implementation} (compiled with {lupa.LUA_VERSION})")
print('All commands:\n1. console - terminal lua\n2. run - run code\n3. exit - exit runner Lua ')
while True:
    command = input('>>>')
    if command == 'console':
        console()
    elif command == 'run':
        run() 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants