{"library":"luaparser","title":"Lua Parser","description":"luaparser is a Python library for parsing Lua code into an Abstract Syntax Tree (AST). It provides a programmatic interface to analyze, manipulate, and generate Lua code. The current version is 4.0.0, and it maintains an active, though irregular, release cadence addressing bugs and adding features.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install luaparser"],"cli":null},"imports":["from luaparser import parse","from luaparser.ast import Node"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from luaparser import parse\n\nlua_code = \"\"\"\n-- This is a simple Lua script\nlocal function greet(name)\n    print(\"Hello, \" .. name .. \"!\")\nend\n\ngreet(\"World\")\n\"\"\"\n\n# Parse the Lua code into an AST\nast = parse(lua_code)\n\n# Print a representation of the AST\n# In luaparser 3.3.1+, parse() no longer prints directly\nprint(ast.show())","lang":"python","description":"Parses a simple Lua script string and prints its Abstract Syntax Tree (AST) representation to the console.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}