aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2019-07-11 16:21:33 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2019-07-11 16:21:33 -0400
commit68abf86021d8dc505ac0b6c91f2b5941a8da9d15 (patch)
treef9bedb43aeb5cb277cec45c70842e906193c3c91 /scripts
parent84b3ba9f05b9ad76ec68c2da2af15afc7bec6685 (diff)
Updated to latest Scintilla LongTerm3 revision.
Scintilla.iface has changed, as has some of its underlying platform API. Testing sooner is better than later.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_iface.lua19
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua
index d21a3208..23f7e98a 100755
--- a/scripts/gen_iface.lua
+++ b/scripts/gen_iface.lua
@@ -6,9 +6,9 @@ local const_patt = '^val ([%w_]+)=([-%dx%x]+)'
local event_patt = '^evt %a+ ([%w_]+)=(%d+)'
local msg_patt = '^(%a+) (%a+) (%w+)=(%d+)%((%a*) ?([^,]*),%s*(%a*)'
local types = {
- [''] = 0, void = 0, int = 1, length = 2, position = 3, colour = 4, bool = 5,
- keymod = 6, string = 7, stringresult = 8, cells = 9, textrange = 10,
- findtext = 11, formatrange = 12
+ [''] = 0, void = 0, int = 1, length = 2, position = 1, line = 1, colour = 3,
+ bool = 4, keymod = 5, string = 6, stringresult = 7, cells = 8, pointer = 1,
+ textrange = 9, findtext = 10, formatrange = 11
}
local ignores = { -- constants to ignore
'^INDIC[012S]_', '^INVALID_POSITION', '^KEYWORDSET_MAX', '^SC_AC_',
@@ -37,18 +37,25 @@ for line in io.lines('../src/scintilla/include/Scintilla.iface') do
constants[#constants + 1] = string_format('SCN_%s=%s', name:upper(), value)
elseif line:find('^fun ') then
local _, rtype, name, id, wtype, param, ltype = line:match(msg_patt)
+ if rtype:find('^%u') then rtype = 'int' end
+ if wtype:find('^%u') then wtype = 'int' end
+ if ltype:find('^%u') then ltype = 'int' end
name = name:gsub('([a-z])([A-Z])', '%1_%2')
:gsub('([A-Z])([A-Z][a-z])', '%1_%2'):lower()
if name == 'convert_eo_ls' then name = 'convert_eols' end
- if wtype == 'int' and param == 'length' then wtype = 'length' end
+ if types[wtype] == types.int and param == 'length' then wtype = 'length' end
functions[#functions + 1] = name
functions[name] = {id, types[rtype], types[wtype], types[ltype]}
elseif line:find('^get ') or line:find('^set ') then
local kind, rtype, name, id, wtype, _, ltype = line:match(msg_patt)
+ if rtype:find('^%u') then rtype = 'int' end
+ if wtype:find('^%u') then wtype = 'int' end
+ if ltype:find('^%u') then ltype = 'int' end
name = name:gsub('[GS]et%f[%u]', ''):gsub('([a-z])([A-Z])', '%1_%2')
:gsub('([A-Z])([A-Z][a-z])', '%1_%2'):lower()
- if kind == 'get' and wtype == 'int' and ltype == 'int' or
- wtype == 'bool' and ltype ~= '' or changed_setter[name] then
+ if kind == 'get' and types[wtype] == types.int and
+ types[ltype] == types.int or wtype == 'bool' and ltype ~= '' or
+ changed_setter[name] then
-- Special case getter/setter; handle as function.
local fname = kind..'_'..name
functions[#functions + 1] = fname