Skip to content

Commit

Permalink
Updated changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFreezed committed May 16, 2021
1 parent dacade8 commit d489c33
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
LuaPreprocess

v1.13.1 (2021-05-16)
Library:
- Dual code now supports multiple identifiers: !!x, y = ...
- Some non-ASCII characters in serialized strings look nicer.
- Added params.fastStrings .
- Fixed backtick strings not working in macros.
Command line program:
- Added --faststrings option.

v1.13 (2021-05-14)
Library:
- Added macros (in the form of '@insert func()' or '@@func()').
Expand Down
2 changes: 1 addition & 1 deletion preprocess-cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ for _, arg in ipairs(args) do
elseif arg == "--silent" then
silent = true

elseif arg == "--faststrings" then -- @Doc
elseif arg == "--faststrings" then
fastStrings = true

else
Expand Down
16 changes: 8 additions & 8 deletions preprocess.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@



local PP_VERSION = "1.13.0"
local PP_VERSION = "1.13.1"

local MAX_DUPLICATE_FILE_INSERTS = 1000 -- @Incomplete: Make this a parameter for processFile()/processString().

Expand Down Expand Up @@ -161,8 +161,6 @@ local ESCAPE_SEQUENCES = {

local USELESS_TOKENS = {whitespace=true, comment=true}

local ERROR_UNFINISHED_VALUE = 1

local major, minor = _VERSION:match"Lua (%d+)%.(%d+)"
if not major then
io.stderr:write("[LuaPreprocess] Warning: Could not detect Lua version.\n")
Expand Down Expand Up @@ -397,6 +395,8 @@ end



local ERROR_UNFINISHED_STRINGLIKE = 1

local function parseStringlike(s, ptr)
local reprStart = ptr
local reprEnd
Expand Down Expand Up @@ -429,7 +429,7 @@ local function parseStringlike(s, ptr)

local i1, i2 = s:find("%]"..longEqualSigns.."%]", ptr)
if not i1 then
return nil, ERROR_UNFINISHED_VALUE
return nil, ERROR_UNFINISHED_STRINGLIKE
end

reprEnd = i2
Expand Down Expand Up @@ -559,7 +559,7 @@ function _tokenize(s, path, allowPpTokens, allowBacktickStrings, allowJitSyntax)
tok, ptr = parseStringlike(s, ptr)
if not tok then
local errCode = ptr
if errCode == ERROR_UNFINISHED_VALUE then
if errCode == ERROR_UNFINISHED_STRINGLIKE then
errorInFile(s, path, reprStart, "Tokenizer", "Unfinished long comment.")
else
errorInFile(s, path, reprStart, "Tokenizer", "Invalid comment.")
Expand Down Expand Up @@ -642,7 +642,7 @@ function _tokenize(s, path, allowPpTokens, allowBacktickStrings, allowJitSyntax)
tok, ptr = parseStringlike(s, ptr)
if not tok then
local errCode = ptr
if errCode == ERROR_UNFINISHED_VALUE then
if errCode == ERROR_UNFINISHED_STRINGLIKE then
errorInFile(s, path, reprStart, "Tokenizer", "Unfinished long string.")
else
errorInFile(s, path, reprStart, "Tokenizer", "Invalid long string.")
Expand Down Expand Up @@ -2749,7 +2749,7 @@ local pp = {
-- backtickStrings = boolean -- [Optional] Enable the backtick (`) to be used as string literal delimiters. Backtick strings don't interpret any escape sequences and can't contain other backticks. (Default: false)
-- jitSyntax = boolean -- [Optional] Allow LuaJIT-specific syntax. (Default: false)
-- canOutputNil = boolean -- [Optional] Allow !() and outputValue() to output nil. (Default: true)
-- fastStrings = boolean -- [Optional] Force fast serialization of string values. (Non-ASCII characters will look ugly.) (Default: false) @Doc
-- fastStrings = boolean -- [Optional] Force fast serialization of string values. (Non-ASCII characters will look ugly.) (Default: false)
-- validate = boolean -- [Optional] Validate output. (Default: true)
--
-- onInsert = function( name ) -- [Optional] Called for each @insert"name" statement. It's expected to return a Lua code string. By default 'name' is a path to a file to be inserted.
Expand All @@ -2775,7 +2775,7 @@ local pp = {
-- backtickStrings = boolean -- [Optional] Enable the backtick (`) to be used as string literal delimiters. Backtick strings don't interpret any escape sequences and can't contain other backticks. (Default: false)
-- jitSyntax = boolean -- [Optional] Allow LuaJIT-specific syntax. (Default: false)
-- canOutputNil = boolean -- [Optional] Allow !() and outputValue() to output nil. (Default: true)
-- fastStrings = boolean -- [Optional] Force fast serialization of string values. (Non-ASCII characters will look ugly.) (Default: false) @Doc
-- fastStrings = boolean -- [Optional] Force fast serialization of string values. (Non-ASCII characters will look ugly.) (Default: false)
-- validate = boolean -- [Optional] Validate output. (Default: true)
--
-- onInsert = function( name ) -- [Optional] Called for each @insert"name" statement. It's expected to return a Lua code string. By default 'name' is a path to a file to be inserted.
Expand Down

0 comments on commit d489c33

Please sign in to comment.