Home | History | Annotate | Download | only in vendor

Lines Matching refs:then

58   if type(obj) ~= 'table' then return type(obj) end
61 if obj[i] ~= nil then i = i + 1 else return 'table' end
63 if i == 1 then return 'table' else return 'array' end
81 if str:sub(pos, pos) ~= delim then
82 if err_if_missing then
95 if pos > #str then error(early_end_error) end
97 if c == '"' then return val, pos + 1 end
98 if c ~= '\\' then return parse_str_val(str, pos + 1, val .. c) end
102 if not nextc then error(early_end_error) end
110 if not val then error('Error parsing number at position ' .. pos .. '.') end
120 if kind == 'array' then
121 if as_key then error('Can\'t encode array as key.') end
124 if i > 1 then s[#s + 1] = ', ' end
128 elseif kind == 'table' then
129 if as_key then error('Can\'t encode table as key.') end
132 if #s > 1 then s[#s + 1] = ', ' end
138 elseif kind == 'string' then
140 elseif kind == 'number' then
141 if as_key then return '"' .. tostring(obj) .. '"' end
143 elseif kind == 'boolean' then
145 elseif kind == 'nil' then
157 if pos > #str then error('Reached unexpected end of input.') end
160 if first == '{' then -- Parse an object.
165 if key == nil then return obj, pos end
166 if not delim_found then error('Comma missing between object items.') end
171 elseif first == '[' then -- Parse an array.
176 if val == nil then return arr, pos end
177 if not delim_found then error('Comma missing between array items.') end
181 elseif first == '"' then -- Parse a string.
183 elseif first == '-' or first:match('%d') then -- Parse a number.
185 elseif first == end_delim then -- End of an object or array.
191 if str:sub(pos, lit_end) == lit_str then return lit_val, lit_end + 1 end