IDL C#: Added flag comments.

This commit is contained in:
Бранимир Караџић
2019-07-14 18:23:57 -07:00
parent 72d0a0c4fa
commit 6b32a32bb2
3 changed files with 600 additions and 6 deletions

View File

@@ -169,7 +169,12 @@ local function FlagBlock(typ)
end
yield("\t/// <summary>")
yield("\t/// " .. flag.comment)
if (type(flag.comment) == "table") then
comment = table.concat(flag.comment, "\n\t\t/// ")
else
comment = flag.comment
end
yield("\t/// " .. comment)
yield("\t/// </summary>")
end
@@ -291,23 +296,35 @@ function converter.types(typ)
end
end
lookup[flagName] = value
table.insert(flags, {
name = flagName,
value = value,
})
if flag.comment ~= nil then
table.insert(flags, {
name = flagName,
value = value,
comment = flag.comment,
})
else
table.insert(flags, {
name = flagName,
value = value,
})
end
end
if typ.shift then
table.insert(flags, {
name = name .. "Shift",
value = typ.shift,
format = "%d",
comment = typ.comment,
})
end
if typ.mask then
-- generate Mask
table.insert(flags, {
name = name .. "Mask",
value = typ.mask,
comment = typ.comment,
})
lookup[name .. "Mask"] = typ.mask
end