Module:Grammar

From Caves of Qud Wiki
Revision as of 20:21, 30 July 2019 by Teamtoto (talk | contribs)
Jump to navigation Jump to search

local p = {}

function p.parse(frame)

local a = string.gsub(frame.args[1], "(%w*)([:.])(%w*)", function(type,_,subtype)
    if (type == "player") then
        return "(player's " .. subtype .. ")"
    elseif (type == "verb" or type == "pronouns") then
        return "{{Grammar|type|subtype|" .. frame.args[2] .. "}}"
    else 
        return "ERROR: Could not parse!"
    end
return "error"
end)
return a
end

return p