Skip to content

Commit bcd7129

Browse files
committed
Add support for CWRAP
1 parent 29e71ef commit bcd7129

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

dist/library/modules/buildings.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
---@class dfhack.buildings
55
---@field containsTile function
6+
---@field setSize function
7+
---@field getStockpileContents function
8+
---@field getCageOccupants function
69
dfhack.buildings = {}
710

811
---@param pos df.coord

dist/library/modules/screen.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
---@meta
33

44
---@class dfhack.screen
5+
---@field raise function
6+
---@field hideGuard function
7+
---@field show function
8+
---@field dismiss function
9+
---@field isDismissed function
510
---@field _doSimulateInput function
611
dfhack.screen = {}
712

lib/cpp.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,16 @@ def parse_cpp_modules(entry_point)
5555
module_declaration = file[/^static.*#{module_name}_module\[\][\s\S]+?};/]
5656
function_declaration = file[/^static.*#{module_name}_funcs\[\][\s\S]+?};/]
5757

58-
# Functions with signatures that are unlikely to be easily parsed.
58+
# Functions with signatures that I currently don't understand well
59+
# enough to parse.
5960
module_declaration&.scan(/(?:WRAP_VERSION_FUNC|WRAPN)\(([^)]+)\)/) do |match|
6061
function_name = match[0].split(', ')[0]
6162
output << "---@field #{function_name} function\n"
6263
end
64+
function_declaration&.scan(/(?:CWRAP)\(([^)]+)\)/) do |match|
65+
function_name = match[0].split(', ')[0]
66+
output << "---@field #{function_name} function\n"
67+
end
6368

6469
# Functions that manipulate lua_state (usually?)
6570
function_declaration&.scan(/^\s+\{([^}]+)}/) do

0 commit comments

Comments
 (0)