+ if type(item) ~= "number" or item > 255 then
+ s = nil;
+ elseif s then
+ s[#s+1] = string_char(item);
+ end
+ t_insert(t, item);
+ end
+ read(); -- read }, or ], or >
+ if s and #s > 0 then
+ return t_concat(s)
+ else
+ return t
+ end;
+end
+local function readBinary()
+ read("<"); -- read <
+ -- Discard PIDs
+ if isNumeric(peek()) then
+ while peek() ~= ">" do read(); end
+ read(">");
+ return {};
+ end
+ local t = readTuple();
+ read(">") -- read >
+ local ch = peek();
+ if type(t) == "string" then
+ -- binary is a list of integers
+ return t;
+ elseif type(t) == "table" then
+ if t[1] then
+ -- binary contains string
+ return t[1];
+ else
+ -- binary is empty
+ return "";
+ end;
+ else
+ error();