-
Notifications
You must be signed in to change notification settings - Fork 3
/
CHANGELOG.txt
88 lines (80 loc) · 4.65 KB
/
CHANGELOG.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Changelog
Dumb Lua Parser
v2.3 (2022-06-23)
- Added utility functions: findDeclaredNames(), findGlobalReferences(), findShadows().
- Added token functions: updateToken(), cloneToken().
- simplify() handles some more cases.
- Fixed newToken("string") always raising an error.
v2.2 (2022-06-02)
- Added function: isStatement().
- Fixed updateReferences() not always updating all references properly (which sometimes broke minify()).
- Fixed backslashes in string literals not being outputted as \\.
- LuaJIT: Fixed validateTree() reporting 64-bit integers as invalid literal values.
v2.1 (2021-09-03)
- Added AST functions: parseExpression(), valueToAst(), validateTree(), isExpression(), newNodeFast().
- Added AST node fields: AstNode.pretty, AstNode.prefix, AstNode.suffix .
- tokenize(): Added option to keep whitespace tokens (which is a new token type).
- toLua(): Added nodeCallback argument.
- toLua(): Outputting less parentheses around some binary expressions.
- toLua(): Fixed invalid output of immediately invoked function expressions and similar expressions.
- toLua(): Fixed "." not always being always being considered when inserting spaces (e.g. for `x .. ...`).
- TableField.key is now optional if TableField.generatedKey is true.
- Fixed "_ENV" getting minified in Lua 5.2+.
- Fixed parsing error for chunks ending in return statements without values.
v2.0 (2021-06-19)
Major changes:
- Added support for Lua 5.4 and LuaJIT.
- Added functions: simplify(), optimize(), minify().
- Tokens are now represented by individual tables. Token streams are now simple arrays of tokens.
- Changed AstIdentifier.declaration to point to the declared identifier instead of the parent declaration/function/'for' loop.
- Changed AstLabel.name and AstGoto.name to be strings instead of identifiers.
- Removed AstFunction.vararg. (Any vararg parameter is now at the end of AstFunction.parameters.)
- Parsing and tokenizing functions no longer print anything on error - they only return the message (which now includes more information).
- toLua() no longer prints anything on error - instead it returns the message.
Added:
- Added support for binary number notation '0b1101001' (from LuaJIT).
- Added special parsing rules for 'n/0'.
- Added AST functions: cloneNode(), cloneTree(), traverseTreeReverse(), getChild(), setChild(), addChild(), removeChild().
- Added token functions: concatTokens(), newToken().
- Added function: formatMessage().
- Added AST node fields: AstVararg.declaration, AstGoto.label, AstIdentifier.attribute .
- Added more common fields to AST nodes.
- Added argument 'leavesFirst' to traverseTree().
- Added argument 'attributeName' to newNode("identifier").
- Added argument 'updateTopNodePosition' to updateReferences().
- Added parser settings: printIds, printLocations, indentation, constantNameReplacementStringMaxLength.
- Added parser constants: INT_SIZE, MAX_INT, MIN_INT.
- Added internal fallback parser for string values so features added in later Lua versions are supported in all versions.
- LuaJIT: Support numeral suffixes 'LL', 'ULL' and 'i'.
Changed:
- 'break' statements are allowed in the middle of blocks (according to Lua 5.2).
- '-0' is no longer normalized to '0' in Lua 5.2 and earlier (except by simplify()) to match Lua's behavior.
- newNode("label") and newNode("goto") now require a 'labelName' argument.
- Renamed parse(path) function variant to parseFile().
- The path argument for parse(luaString) function variant is now optional.
- Renamed tokenizeString() to tokenize() (to follow the same naming scheme as parse() and parseFile()).
- toLua(): Improved string literal output.
- toLua(): Integers gets outputted as integers (as opposed to floats with scientific notation) in more cases.
- Updated "malformed number" error detection.
- Parsing: Improved location information for blocks and functions.
- Whitespace is no longer trimmed from comment tokens.
- Improved error messages.
Removed:
- Removed functions: newTokenStream(), insertToken(), removeToken().
Fixed:
- Fixed toLua() outputting expressions like '- -x' as '--x'.
- Fixed printTokens() and printNode() printing unprintable/"bad" characters in strings.
- Fixed the location in a syntax error message.
- Fixed questionable handling of newlines in single-line comment tokens.
Repository:
- Added examples.lua.
v1.2.1 (2021-06-01)
- Fixed lookups and calls that shouldn't parse, like "":sub().
v1.2.0 (2021-05-13)
- Added parser.updateReferences().
- Changed arguments for parser.traverseTree() and the callback.
- Fixed parsing of consecutive unary operations.
v1.1.0 (2020-07-06)
- Added parser.traverseTree().
v1.0.0 (2020-07-05)
- Initial release!