From 156e2b5d97ac7a702e655dc3a1e260c72eecaa9c Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 6 Aug 2015 08:56:18 +0800 Subject: fix typoes in nerv.error --- nerv/init.lua | 14 +++++++++----- 1 file 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, ...) -- cgit v1.2.3-70-g09d2