Added Lua interpreter application

This commit is contained in:
Igor Timofeev
2019-01-26 13:08:02 +03:00
parent e15741c24a
commit fee7ca24de
8 changed files with 220 additions and 28 deletions

View File

@@ -3,15 +3,16 @@ local text = {}
--------------------------------------------------------------------------------
function text.serialize(t, prettyLook, indentationWidth, indentUsingTabs, recursionStackLimit)
function text.serialize(t, prettyLook, indentator, recursionStackLimit)
checkArg(1, t, "table")
recursionStackLimit = recursionStackLimit or math.huge
local indentationSymbolAdder = string.rep(indentUsingTabs and " " or " ", indentationWidth or 2)
indentator = indentator or " "
local equalsSymbol = prettyLook and " = " or "="
local function serialize(t, currentIndentationSymbol, currentRecusrionStack)
local result, nextIndentationSymbol, keyType, valueType, stringValue = {"{"}, currentIndentationSymbol .. indentationSymbolAdder
local result, nextIndentationSymbol, keyType, valueType, stringValue = {"{"}, currentIndentationSymbol .. indentator
if prettyLook then
table.insert(result, "\n")