Skip to content

Commit

Permalink
Register 'utf8' Lua package and make it available to users
Browse files Browse the repository at this point in the history
'utf8' is a new Lua5.3 package https://www.lua.org/manual/5.3/manual.html#6.5
  • Loading branch information
anatol authored and gittup committed Jun 1, 2016
1 parent c1b1478 commit 5598eea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/html/lua_parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ <h1>API</h1>
<li><span class="cmd">math</span> is defined.</li>
<li><span class="cmd">debug</span> is defined.</li>
<li><span class="cmd">io</span> is defined.</li>
<li><span class="cmd">utf8</span> is defined.</li>
</ul>
<p>Tup-specific functions are provided in the <span class="cmd">tup</span> table. In the following documentation, <dfn>PROCESSING</dfn> refers to the directory Tup is currently processing, and <dfn>RUNNING</dfn> refers to the directory of the build definition file Tup is currently running. When Tup enters <span class="filename">Tupfile.lua</span>, PROCESSING and RUNNING are the same. When running <span class="filename">Tuprules.lua</span> or an explicitly included file, PROCESSING AND RUNNING may be different.</p>
<dl>
Expand Down
1 change: 1 addition & 0 deletions src/tup/luaparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ int parse_lua_tupfile(struct tupfile *tf, struct buf *b, const char *name)
luaL_requiref(ls, LUA_MATHLIBNAME, luaopen_math, 1); lua_pop(ls, 1);
luaL_requiref(ls, LUA_DBLIBNAME, luaopen_debug, 1); lua_pop(ls, 1);
luaL_requiref(ls, LUA_IOLIBNAME, luaopen_io, 1); lua_pop(ls, 1);
luaL_requiref(ls, LUA_UTF8LIBNAME, luaopen_utf8, 1); lua_pop(ls, 1);
lua_pushnil(ls); lua_setglobal(ls, "dofile");
lua_pushnil(ls); lua_setglobal(ls, "loadfile");
lua_pushnil(ls); lua_setglobal(ls, "load");
Expand Down

0 comments on commit 5598eea

Please sign in to comment.