Merge pull request #23250 from bfredl/vimvim

refactor(build): move the last generator from scripts/ to src/nvim/generators
This commit is contained in:
bfredl 2023-04-21 17:28:52 +02:00 committed by GitHub
commit a0adc51dac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 15 deletions

View File

@ -1,4 +1,4 @@
set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genvimvim.lua)
set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/src/nvim/generators/gen_vimvim.lua)
set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime)
set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim)
set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags)
@ -13,8 +13,7 @@ get_directory_property(LUA_GEN DIRECTORY ${PROJECT_SOURCE_DIR}/src/nvim DEFINITI
get_directory_property(LUA_GEN_DEPS DIRECTORY ${PROJECT_SOURCE_DIR}/src/nvim DEFINITION LUA_GEN_DEPS)
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
COMMAND ${LUA_GEN} ${SYN_VIM_GENERATOR}
${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_SYN_VIM} ${FUNCS_DATA}
COMMAND ${LUA_GEN} ${SYN_VIM_GENERATOR} ${GENERATED_SYN_VIM} ${FUNCS_DATA}
DEPENDS
${LUA_GEN_DEPS}
${SYN_VIM_GENERATOR}

View File

@ -1,17 +1,7 @@
local mpack = vim.mpack
if arg[1] == '--help' then
print('Usage: lua genvimvim.lua src/nvim runtime/syntax/vim/generated.vim')
os.exit(0)
end
local nvimsrcdir = arg[1]
local syntax_file = arg[2]
local funcs_file = arg[3]
package.path = nvimsrcdir .. '/?.lua;' .. package.path
_G.vim = loadfile(nvimsrcdir..'/../../runtime/lua/vim/shared.lua')()
local syntax_file = arg[1]
local funcs_file = arg[2]
local lld = {}
local syn_fd = io.open(syntax_file, 'w')