Mercurial > prosody-hg
comparison util/stanza.lua @ 4797:e239668aa6d2
Merge 0.9->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 29 Apr 2012 02:10:55 +0100 |
| parents | b9de59ea8dad |
| children | 92c86e11fd44 |
comparison
equal
deleted
inserted
replaced
| 4796:04a34287dc12 | 4797:e239668aa6d2 |
|---|---|
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 | 9 |
| 10 local t_insert = table.insert; | 10 local t_insert = table.insert; |
| 11 local t_concat = table.concat; | |
| 12 local t_remove = table.remove; | 11 local t_remove = table.remove; |
| 13 local t_concat = table.concat; | 12 local t_concat = table.concat; |
| 14 local s_format = string.format; | 13 local s_format = string.format; |
| 15 local s_match = string.match; | 14 local s_match = string.match; |
| 16 local tostring = tostring; | 15 local tostring = tostring; |
| 17 local setmetatable = setmetatable; | 16 local setmetatable = setmetatable; |
| 18 local getmetatable = getmetatable; | |
| 19 local pairs = pairs; | 17 local pairs = pairs; |
| 20 local ipairs = ipairs; | 18 local ipairs = ipairs; |
| 21 local type = type; | 19 local type = type; |
| 22 local next = next; | |
| 23 local print = print; | |
| 24 local unpack = unpack; | |
| 25 local s_gsub = string.gsub; | 20 local s_gsub = string.gsub; |
| 26 local s_char = string.char; | |
| 27 local s_find = string.find; | 21 local s_find = string.find; |
| 28 local os = os; | 22 local os = os; |
| 29 | 23 |
| 30 local do_pretty_printing = not os.getenv("WINDIR"); | 24 local do_pretty_printing = not os.getenv("WINDIR"); |
| 31 local getstyle, getstring; | 25 local getstyle, getstring; |
| 256 end | 250 end |
| 257 end | 251 end |
| 258 return type, condition or "undefined-condition", text; | 252 return type, condition or "undefined-condition", text; |
| 259 end | 253 end |
| 260 | 254 |
| 261 function stanza_mt.__add(s1, s2) | |
| 262 return s1:add_direct_child(s2); | |
| 263 end | |
| 264 | |
| 265 | |
| 266 do | 255 do |
| 267 local id = 0; | 256 local id = 0; |
| 268 function new_id() | 257 function new_id() |
| 269 id = id + 1; | 258 id = id + 1; |
| 270 return "lx"..id; | 259 return "lx"..id; |
