diff options
| author | dqnne <173300634+dqnne@users.noreply.github.com> | 2026-07-21 12:53:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-21 06:53:41 -0400 |
| commit | a71ee754ee4bb88fc2d2fbe67972f24c5a6d7883 (patch) | |
| tree | 17e4807d702f9abd75364fa690bcde0f5c6aa425 /src/gen | |
| parent | 08cfbb8f371ddb85fcb3c35314f76e6de4da2f61 (diff) | |
| download | rneovim-a71ee754ee4bb88fc2d2fbe67972f24c5a6d7883.tar.gz rneovim-a71ee754ee4bb88fc2d2fbe67972f24c5a6d7883.tar.bz2 rneovim-a71ee754ee4bb88fc2d2fbe67972f24c5a6d7883.zip | |
build(api): unused labels in generated Lua bindings #40880
Problem:
Generated API bindings for Lua contain unused jump labels when the API
function has a non-KeyDict (e.g., Array) param after a KeyDict param, causing
the build to fail.
Solution:
Don't output a label when the current parameter is not a KeyDict but the
previous one is.
Diffstat (limited to 'src/gen')
| -rw-r--r-- | src/gen/gen_api_dispatch.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gen/gen_api_dispatch.lua b/src/gen/gen_api_dispatch.lua index 731a9a0097..d243106750 100644 --- a/src/gen/gen_api_dispatch.lua +++ b/src/gen/gen_api_dispatch.lua @@ -952,7 +952,9 @@ local function process_function(fn) for i = 1, #free_code do local rev_i = #free_code - i + 1 local code = free_code[rev_i] - if i == 1 and not real_type(fn.parameters[1][1]):match('^KeyDict_') then + local cur_is_keydict = real_type(fn.parameters[i][1]):match('^KeyDict_') + local prev_is_keydict = i > 1 and real_type(fn.parameters[i - 1][1]):match('^KeyDict_') + if not cur_is_keydict and (i == 1 or prev_is_keydict) then free_at_exit_code = free_at_exit_code .. ('\n%s'):format(code) else free_at_exit_code = free_at_exit_code .. ('\nexit_%u:\n%s'):format(rev_i, code) |