Module:Scale tree: Difference between revisions
No edit summary |
No edit summary |
||
| Line 36: | Line 36: | ||
function p.parse_kv_pairs(unparsed) | function p.parse_kv_pairs(unparsed) | ||
-- Tokenize the string of unparsed pairs | -- Tokenize the string of unparsed pairs | ||
local | local parsed = p.parse_entries(unparsed) | ||
-- Then tokenize the tokens into key-value pairs | -- Then tokenize the tokens into key-value pairs | ||
local | local pairs_ = {} | ||
for | for i = 1, #parsed do | ||
local | local pair = p.parse_pair(parsed[i]) | ||
if # | if #pair == 2 then | ||
pairs_[pair[1]] = pair[2] | |||
end | end | ||
end | end | ||
return | return pairs_ | ||
end | end | ||