Created
December 5, 2017 04:38
-
-
Save anonymous/35b76407db03b8296f6cc06c408ec900 to your computer and use it in GitHub Desktop.
Minimal Lua interpreter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <lua.h> | |
#include <lualib.h> | |
#include <lauxlib.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
lua_State *L = luaL_newstate(); | |
luaL_openlibs(L); | |
if (argc == 2) | |
luaL_dofile(L, argv[1]); | |
else | |
fprintf(stderr, "Usage: %s <script.lua>\n", argv[0]); | |
lua_close(L); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment