Skip to content

Commit 2a454a3

Browse files
committed
Reject lua_State arguments from cpp functions
1 parent 2001dd4 commit 2a454a3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

dist/library/modules/dfhack.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
---@field isPrerelease function
1616
dfhack = {}
1717

18-
---@param state df.lua_State
1918
---@return integer
20-
function dfhack.getCommandHistory(state) end
19+
function dfhack.getCommandHistory() end
2120

2221
---@return string
2322
function dfhack.getOSType() end

lib/cpp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def parse_function(match, module_name:, prefix:, function_name:)
6969

7070
if captures[1]
7171
# TODO: Naming convention or actual compiler behaviour?
72-
arguments = captures[1].split(',').reject.with_index { |arg, index| arg[/&\s*out/] && index.zero? }
72+
arguments = captures[1].split(',').reject.with_index { |arg, index| arg[/(&\s*out)|lua_State/] && index.zero? }
7373
arguments = arguments.map { |arg| arg.gsub(/const\s+|[*&]/, '').strip }
7474
arguments = arguments&.map do |argument|
7575
type, _, name = argument.rpartition(' ')

0 commit comments

Comments
 (0)