woops, don't crash on empty string

This commit is contained in:
leaf corcoran 2012-09-30 17:58:46 -07:00
parent d272f6a04c
commit bd258bd79a
4 changed files with 4 additions and 2 deletions

View File

@ -1143,7 +1143,7 @@ Value = Transformer({
return { return {
"string", "string",
delim, delim,
part part or ""
} }
else else
return build.chain({ return build.chain({

View File

@ -598,7 +598,7 @@ Value = Transformer {
convert_part = (part) -> convert_part = (part) ->
if type(part) == "string" or part == nil if type(part) == "string" or part == nil
{"string", delim, part} {"string", delim, part or ""}
else else
build.chain { base: "tostring", {"call", {part[2]}} } build.chain { base: "tostring", {"call", {part[2]}} }

View File

@ -26,6 +26,7 @@ hola = [===[
mm = [[well trhere]] mm = [[well trhere]]
oo = ""
x = "\\" x = "\\"
x = "a\\b" x = "a\\b"

View File

@ -12,6 +12,7 @@ local hi_there = [[ hi there
local well = [==[ "helo" ]==] local well = [==[ "helo" ]==]
local hola = [===[ eat noots]===] local hola = [===[ eat noots]===]
local mm = [[well trhere]] local mm = [[well trhere]]
local oo = ""
local x = "\\" local x = "\\"
x = "a\\b" x = "a\\b"
x = "\\\n" x = "\\\n"