From d51f3ed53326ea482c28e8b1a11b95119d3b581b Mon Sep 17 00:00:00 2001
From: "p.kosyh"
Date: Thu, 16 Sep 2010 16:27:21 +0000
Subject: [PATCH] delimiter fix
---
stead/object.lua | 2 +-
stead/xact.lua | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/stead/object.lua b/stead/object.lua
index 5df2b22..ce91b5b 100644
--- a/stead/object.lua
+++ b/stead/object.lua
@@ -202,7 +202,7 @@ function list_concat(self, other, pos)
end
end
-stead.delim = '~'
+stead.delim = '|'
function list_str(self)
local i, v, vv, o;
diff --git a/stead/xact.lua b/stead/xact.lua
index 3a16077..a6a8d06 100644
--- a/stead/xact.lua
+++ b/stead/xact.lua
@@ -36,8 +36,13 @@ __do_xact = function(str, self)
local xrefrep = function(str)
local s = stead.string.gsub(str,'[{}]','');
local o,d,a, oo;
- s = s:gsub("\\:","<:>");
- local i = s:find(":", 1, true);
+ local delim = ':'
+
+ if stead.api_version >= "1.2.2" then
+ delim = stead.delim;
+ end
+ s = s:gsub("\\"..delim, "<&delim;>");
+ local i = s:find(delim, 1, true);
aarg = {}
if i then
o = s:sub(1, i - 1);
@@ -66,7 +71,7 @@ __do_xact = function(str, self)
else
error("Wrong link: "..s, 3);
end
- d = d:gsub("<:>", ":");
+ d = d:gsub("<&delim;>", delim);
return xref(d, ref(oo, true), unpack(aarg));
end
if type(str) ~= 'string' then return end