Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161149535
D14580.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14580.id.diff
View Options
Index: head/stand/liblua/lutils.c
===================================================================
--- head/stand/liblua/lutils.c
+++ head/stand/liblua/lutils.c
@@ -97,6 +97,24 @@
}
static int
+lua_parse(lua_State *L)
+{
+ int argc, nargc;
+ char **argv;
+
+ if (parse(&argc, &argv, luaL_checkstring(L, 1)) == 0) {
+ for (nargc = 0; nargc < argc; ++nargc) {
+ lua_pushstring(L, argv[nargc]);
+ }
+ free(argv);
+ return nargc;
+ }
+
+ lua_pushnil(L);
+ return 1;
+}
+
+static int
lua_getchar(lua_State *L)
{
@@ -325,6 +343,7 @@
REG_SIMPLE(delay),
REG_SIMPLE(command),
REG_SIMPLE(interpret),
+ REG_SIMPLE(parse),
REG_SIMPLE(getenv),
REG_SIMPLE(perform),
/* Also registered as the global 'printc' */
Index: head/stand/lua/cli.lua
===================================================================
--- head/stand/lua/cli.lua
+++ head/stand/lua/cli.lua
@@ -94,6 +94,10 @@
end
+function cli.execute_unparsed(str)
+ cli_execute(loader.parse(str))
+end
+
-- Module exports
function cli.boot(...)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 2, 12:19 AM (18 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34581698
Default Alt Text
D14580.id.diff (1 KB)
Attached To
Mode
D14580: lualoader: Expose loader.parse and add cli.parse_and_execute
Attached
Detach File
Event Timeline
Log In to Comment