aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-08-06 08:56:18 +0800
committerDeterminant <[email protected]>2015-08-06 08:56:18 +0800
commit156e2b5d97ac7a702e655dc3a1e260c72eecaa9c (patch)
treeef033c40d4bb3b083e91ca70ce9852e42b6293b7
parent7579ff4941d7019d4e911978879ec07b62a4e523 (diff)
fix typoes in nerv.error
-rw-r--r--nerv/init.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/nerv/init.lua b/nerv/init.lua
index 183ae6d..9c1a5c8 100644
--- a/nerv/init.lua
+++ b/nerv/init.lua
@@ -1,15 +1,19 @@
require 'libnerv'
-function nerv.error(fmt, ...)
- error("[nerv] internal error: " .. fmt .. "\n", ...)
-end
-
function nerv.error_method_not_implemented()
nerv.error("method not implemented");
end
+function nerv.sprintf(fmt, ...)
+ return string.format(fmt, ...)
+end
+
function nerv.printf(fmt, ...)
- io.write(string.format(fmt, ...))
+ io.write(nerv.sprintf(fmt, ...))
+end
+
+function nerv.error(fmt, ...)
+ error(nerv.sprintf("[nerv] internal error: " .. fmt .. "\n", ...))
end
function nerv.mesg_with_timestamp(fmt, ...)