GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — rizu/luajit.lua at master · semyon422/rizu Expand file tree/ Copy pathluajit.luaMore file actions executable file ·50 lines (43 loc) · 1.14 KB / Copy pathluajit.luaFile metadata and controlsexecutable file ·50 lines (43 loc) · 1.14 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 #!/usr/bin/env luajit require("pkg_config") --- Parse -e flag and script path from arg. --- Returns (loader, remaining_arg_index). --- @return fun() loader --- @return integer next_arg local function parse_args() if arg[1] == "-e" then local code = arg[2] if not code then error("Usage: luajit.lua -e <code> [args...]", 0) end local f, err = load(code, "=(command line)") if not f then error(string.format("Cannot load code: %s", err), 0) end return f, 3 end local script_path = arg[1] if script_path == "-" then local code = io.read("*a") local f, err = load(code, "=(stdin)") if not f then error(string.format("Cannot load stdin: %s", err), 0) end return f, 2 end if not script_path then print("Usage: luajit.lua <script.lua> [args...]\n luajit.lua - [args...]\n luajit.lua -e <code> [args...]") os.exit(1) end local f, err = loadfile(script_path) if not f then error(string.format("Cannot load %s: %s", script_path, err), 0) end return f, 2 end local f, next_arg = parse_args() -- Trim arg so the script receives only its own arguments for i = 1, next_arg - 1 do table.remove(arg, 1) end f() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |