Skip to content

Commit d489c33

Browse files
committed
Updated changelog.
1 parent dacade8 commit d489c33

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

Changelog.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
LuaPreprocess
33

4+
v1.13.1 (2021-05-16)
5+
Library:
6+
- Dual code now supports multiple identifiers: !!x, y = ...
7+
- Some non-ASCII characters in serialized strings look nicer.
8+
- Added params.fastStrings .
9+
- Fixed backtick strings not working in macros.
10+
Command line program:
11+
- Added --faststrings option.
12+
413
v1.13 (2021-05-14)
514
Library:
615
- Added macros (in the form of '@insert func()' or '@@func()').

preprocess-cl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ for _, arg in ipairs(args) do
314314
elseif arg == "--silent" then
315315
silent = true
316316

317-
elseif arg == "--faststrings" then -- @Doc
317+
elseif arg == "--faststrings" then
318318
fastStrings = true
319319

320320
else

preprocess.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118

119119

120120

121-
local PP_VERSION = "1.13.0"
121+
local PP_VERSION = "1.13.1"
122122

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

@@ -161,8 +161,6 @@ local ESCAPE_SEQUENCES = {
161161

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

164-
local ERROR_UNFINISHED_VALUE = 1
165-
166164
local major, minor = _VERSION:match"Lua (%d+)%.(%d+)"
167165
if not major then
168166
io.stderr:write("[LuaPreprocess] Warning: Could not detect Lua version.\n")
@@ -397,6 +395,8 @@ end
397395

398396

399397

398+
local ERROR_UNFINISHED_STRINGLIKE = 1
399+
400400
local function parseStringlike(s, ptr)
401401
local reprStart = ptr
402402
local reprEnd
@@ -429,7 +429,7 @@ local function parseStringlike(s, ptr)
429429

430430
local i1, i2 = s:find("%]"..longEqualSigns.."%]", ptr)
431431
if not i1 then
432-
return nil, ERROR_UNFINISHED_VALUE
432+
return nil, ERROR_UNFINISHED_STRINGLIKE
433433
end
434434

435435
reprEnd = i2
@@ -559,7 +559,7 @@ function _tokenize(s, path, allowPpTokens, allowBacktickStrings, allowJitSyntax)
559559
tok, ptr = parseStringlike(s, ptr)
560560
if not tok then
561561
local errCode = ptr
562-
if errCode == ERROR_UNFINISHED_VALUE then
562+
if errCode == ERROR_UNFINISHED_STRINGLIKE then
563563
errorInFile(s, path, reprStart, "Tokenizer", "Unfinished long comment.")
564564
else
565565
errorInFile(s, path, reprStart, "Tokenizer", "Invalid comment.")
@@ -642,7 +642,7 @@ function _tokenize(s, path, allowPpTokens, allowBacktickStrings, allowJitSyntax)
642642
tok, ptr = parseStringlike(s, ptr)
643643
if not tok then
644644
local errCode = ptr
645-
if errCode == ERROR_UNFINISHED_VALUE then
645+
if errCode == ERROR_UNFINISHED_STRINGLIKE then
646646
errorInFile(s, path, reprStart, "Tokenizer", "Unfinished long string.")
647647
else
648648
errorInFile(s, path, reprStart, "Tokenizer", "Invalid long string.")
@@ -2749,7 +2749,7 @@ local pp = {
27492749
-- 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)
27502750
-- jitSyntax = boolean -- [Optional] Allow LuaJIT-specific syntax. (Default: false)
27512751
-- canOutputNil = boolean -- [Optional] Allow !() and outputValue() to output nil. (Default: true)
2752-
-- fastStrings = boolean -- [Optional] Force fast serialization of string values. (Non-ASCII characters will look ugly.) (Default: false) @Doc
2752+
-- fastStrings = boolean -- [Optional] Force fast serialization of string values. (Non-ASCII characters will look ugly.) (Default: false)
27532753
-- validate = boolean -- [Optional] Validate output. (Default: true)
27542754
--
27552755
-- 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.
@@ -2775,7 +2775,7 @@ local pp = {
27752775
-- 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)
27762776
-- jitSyntax = boolean -- [Optional] Allow LuaJIT-specific syntax. (Default: false)
27772777
-- canOutputNil = boolean -- [Optional] Allow !() and outputValue() to output nil. (Default: true)
2778-
-- fastStrings = boolean -- [Optional] Force fast serialization of string values. (Non-ASCII characters will look ugly.) (Default: false) @Doc
2778+
-- fastStrings = boolean -- [Optional] Force fast serialization of string values. (Non-ASCII characters will look ugly.) (Default: false)
27792779
-- validate = boolean -- [Optional] Validate output. (Default: true)
27802780
--
27812781
-- 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.

0 commit comments

Comments
 (0)