feat(Function_Info): fixup record parameter name
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/docker-build Pipeline was successful Details
ci/woodpecker/pr/lint Pipeline was successful Details

This commit is contained in:
Aire-One 2023-01-08 17:39:34 +01:00
parent 59ab75dcf0
commit c67f137628
1 changed files with 18 additions and 0 deletions

View File

@ -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,