Releases: ReFreezed/LuaPreprocess
Releases · ReFreezed/LuaPreprocess
Version 1.13
Changes
Library:
- Added macros (in the form of
@insert func()
or@@func()
). - Fixed processedFileInfo.hasPreprocessorCode being false even though
@keywords
were present. - processedFileInfo.hasPreprocessorCode now means anything that isn't pure Lua.
- Added processedFileInfo.hasMetaprogram.
- Revised the whole error handling system. (Things should be more stable and nicer now.)
- Fixed errors getting printed to stdout instead of stderr.
Command line program:
- Fixed additional stack overflow error when there's an error in the "fileerror" message handler.
Version 1.12
Changes
Library:
- Added support for LuaJIT-specific syntax.
- Output validation can be disabled with
params.validate = false
. - Added aliases for some number formats.
- Fixed parsing of
&
,|
and~
operators.
Command line program:
- Added --jitsyntax and --novalidate options.
Version 1.11.2
Changes
Library:
- Fixed parsing of numbers ending with a point.
Command line program:
- Added
--backtickstrings
and--nonil
options (for specifying params.backtickStrings and params.canOutputNil).
Version 1.11.1
Changes
Library:
- Huge numbers are now outputted as
1/0
instead ofmath.huge
. - Fixed
newToken("pp_keyword",...)
not accepting all preprocessor keywords. - Better error message for unescaped newlines in string literals.
Other:
- Preprocess.cmd returns
%ERRORLEVEL%
.
Version 1.11
Changes
Library:
- Added params.onInsert() which can be used to change what @insert inserts.
- Added params.canOutputNil for disallowing
!()
and outputValue() from outputting nil. - Added @file and @line keywords.
- Outputted strings now have more characters escaped.
- params.onAfterMeta() can now prepend shebang to the code without causing a code validation error.
- Fixed sometimes bad output when a preprocessor line ended with a comment.
- Fixed an internal error.
Command line program:
- Added message: "insert"
Version 1.10
Changes
Library:
- Added the concept of preprocessor keywords in the form of
@keyword
. - Added @insert.
- Added processedFileInfo.insertedFiles.
Version 1.9
Changes
Library:
run()
can now send arguments to the executed file.- Fixed issues when the last line in a file was a preprocessor line.
Command line program:
- Added
--outputpaths
option for specifying an output path for each input path. - Added
outputPaths
argument to"init"
message. - Added
processedFileInfo.outputPath
. - Added some short-form options.
- Updated byte units. (Now displaying KiB instead of kB etc.)
Version 1.8
Changes
Library:
- Added functions:
copyTable()
,pack()
,getCurrentPathIn()
,getCurrentPathOut()
. - Fixed an issue with whitespace after
!...
. - Fixed
tokenize()
triggering an error instead of returning the error message. - Updated/fixed various other error handling stuff.
Command line program:
- Added
--data
option. - The message handler can now be a table of functions.
- Added
"fileerror"
message.
Version 1.7
Changes:
- Hexadecimal fractions & binary exponents are now handled (e.g.
0x12a.8bP+2
). - Added missing token
::
. - Added
getNextUsefulToken()
. - Dual code now only accepts a single assignment statement on the line.
- Updated detection of malformed numbers.
- Fixed internal error "error object is a nil value" in Lua 5.3.
Version 1.6
Changes:
- Added backtick strings (see below).
- Added more functions for handling tokens (
removeUselessTokens()
,eachToken()
,isToken()
). - Renamed the command line program (
main.lua
) topreprocess-cl.lua
.
Backtick strings, enabled with params.backtickStrings
, allows the backtick character (`) to be used as string literal delimiters. This hack can be nice if you, for example, have Lua code inside strings and want to trick your text editor to apply syntax highlighting to the string contents as if it was normal Lua.
local functionString = `function sayHello() print("Hello!") end`
outputLua(functionString)