Merge pull request 'Properly name the functions record parameters (#56)' (#71) from feat/#56 into master
Reviewed-on: #71
This commit is contained in:
commit
00fa0dce30
|
@ -1,6 +1,8 @@
|
|||
local List = require "pl.List"
|
||||
local Map = require "pl.Map"
|
||||
local Type_Info = require "entity.Type_Info"
|
||||
local Variable_Info = require "entity.Variable_Info"
|
||||
local utils = require "utils"
|
||||
|
||||
local record Function_Info
|
||||
metamethod __call: function(
|
||||
|
@ -28,6 +30,21 @@ local function fixup_parameters(self: Function_Info)
|
|||
end
|
||||
end
|
||||
|
||||
local function fixup_record_parameter(self: Function_Info)
|
||||
for p in self.parameters:iter() do
|
||||
for t in p.types:iter() do
|
||||
if t.record_entries and
|
||||
(t.record_entries as Map<string, any>):len() > 0 then
|
||||
t.name = string.format(
|
||||
"%s_%s",
|
||||
utils.capitalize(self.name),
|
||||
utils.capitalize(t.name)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function fixup_return_types(self: Function_Info)
|
||||
for r in self.return_types:iter() do
|
||||
r:fixup()
|
||||
|
@ -65,6 +82,7 @@ local __Function_Info: metatable<Function_Info> = {
|
|||
|
||||
fixup = function(self: Function_Info)
|
||||
fixup_parameters(self)
|
||||
fixup_record_parameter(self)
|
||||
fixup_return_types(self)
|
||||
fixup_signal_type(self)
|
||||
end,
|
||||
|
|
Loading…
Reference in New Issue