luaformatter READMEFeatureslua代码格式化,premake脚本格式化 使用ltokenp进行lua代码格式化 ltokenp代码基于lua5.4.7, lua website: https://www.lua.org/ ltokenp来自lua作者,是在lua代码上简单改动,原生lua语法解析器ltokenp from Luiz Henrique de Figueiredo。 为了输出注释,本项目对ltokenp进行了修改。 格式化的内容:
gemini tranlate: Formatting Lua code Formatting premake code Using ltokenp to format Lua code ltokenp code based on lua5.4.7 ltokenp is derived from the original Lua syntax parser. ltokenp is a slightly modified version of the original Lua, ltokenp created by the Lua author. Formatting operations:
使用说明当被格式化文件中有 '-- fmt-premake' 标志时,按premake格式化脚本, When the file to be formatted contains the '-- fmt-premake' flag, the script will be formatted according to premake's style.
所有格式化逻辑在fmtlcode.lua脚本中,您可根据需要修改fmtlcode.lua脚本 All the formatting rules are implemented in the fmtlcode.lua file. You can customize it to fit your specific needs. 可以从 这里 的test目录下载最新的fmtlcode.lua文件,更新到本地ltokenp目录。 您也可以执行一下命令格式化文件:
To update the fmtlcode.lua file, you can download the latest version from here. To format your Lua script, simply run the following command:
Extension Settings配置需要设置ltokenp所在的路径,路径结尾不能有"/"。 The configuration requires you to set the path to ltokenp. The path cannot end with a "/".
The installation package includes the executable file ltokenp.exe for Windows systems and the corresponding executable ltokenp for Linux systems. 安装程序带了ltokenp.exe(windows)和ltokenp(linux),fmtlcode.lua,设置 windows:
ubuntu
Installing ltokenp下载 ltokenp源码 https://github.com/jerry2mouse/ltokenp 下载 premake 进入源码目录,在windows系统上 premake5 vs20xx 在linux上 ./premake5 gmake2 0.0.3增加支持格式化 premake脚本功能 For more information
Enjoy! |