Skip to content

Add lua library imports and improve print() function #1

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

Merged
merged 6 commits into from
Oct 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add string library
  • Loading branch information
Sasszem committed Jan 27, 2019
commit 424b2a1a0853ccdebaac86d39d51af36014cfb75
1 change: 1 addition & 0 deletions src/LuaWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ LuaWrapper::LuaWrapper() {

luaopen_base(_state);
luaopen_table(_state);
luaopen_string(_state);

lua_register(_state, "pinMode", lua_wrapper_pinMode);
lua_register(_state, "digitalWrite", lua_wrapper_digitalWrite);
Expand Down
1 change: 1 addition & 0 deletions src/lua/lstrlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,7 @@ static void createmetatable (lua_State *L) {
LUAMOD_API int luaopen_string (lua_State *L) {
luaL_newlib(L, strlib);
createmetatable(L);
lua_setglobal(L, "string");
return 1;
}