diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-04-21 16:46:35 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-04-21 16:46:35 +0200 |
commit | 702892270dec627acb3dd585495ee0950f690bde (patch) | |
tree | 4f9b15237b83b7924ef5fca212d463f45773e741 | |
parent | 558e4191f049662065984677a9c7cdbb1518092a (diff) | |
download | rneovim-702892270dec627acb3dd585495ee0950f690bde.tar.gz rneovim-702892270dec627acb3dd585495ee0950f690bde.tar.bz2 rneovim-702892270dec627acb3dd585495ee0950f690bde.zip |
refactor(build): move the last generator from scripts/ to src/nvim/generators
This one generates a runtime/ file instead of a source file.
But otherwise it works the same like all other generators.
It has the same prerequisites (shared and mpack modules, etc), and,
importantly, it uses results from the source generators.
The odd location makes it easy to overlook when refactoring generators
(like I did last time, lol)
-rw-r--r-- | runtime/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/nvim/generators/gen_vimvim.lua (renamed from scripts/genvimvim.lua) | 14 |
2 files changed, 4 insertions, 15 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 5d69962aba..0077604141 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -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} diff --git a/scripts/genvimvim.lua b/src/nvim/generators/gen_vimvim.lua index 18279d160e..09a7cab0c6 100644 --- a/scripts/genvimvim.lua +++ b/src/nvim/generators/gen_vimvim.lua @@ -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') |