|
1 | 1 | Changelog |
2 | 2 | Dumb Lua Parser |
3 | 3 |
|
| 4 | +v2.0 (2021-06-19) |
| 5 | +Major changes: |
| 6 | +- Added support for Lua 5.4 and LuaJIT. |
| 7 | +- Added functions: simplify(), optimize(), minify(). |
| 8 | +- Tokens are now represented by individual tables. Token streams are now simple arrays of tokens. |
| 9 | +- Changed AstIdentifier.declaration to point to the declared identifier instead of the parent declaration/function/'for' loop. |
| 10 | +- Changed AstLabel.name and AstGoto.name to be strings instead of identifiers. |
| 11 | +- Removed AstFunction.vararg. (Any vararg parameter is now at the end of AstFunction.parameters.) |
| 12 | +- Parsing and tokenizing functions no longer print anything on error - they only return the message (which now includes more information). |
| 13 | +- toLua() no longer prints anything on error - instead it returns the message. |
| 14 | +Added: |
| 15 | +- Added support for binary number notation '0b1101001' (from LuaJIT). |
| 16 | +- Added special parsing rules for 'n/0'. |
| 17 | +- Added AST functions: cloneNode(), cloneTree(), traverseTreeReverse(), getChild(), setChild(), addChild(), removeChild(). |
| 18 | +- Added token functions: concatTokens(), newToken(). |
| 19 | +- Added function formatMessage(). |
| 20 | +- Added AST node fields: AstVararg.declaration, AstGoto.label, AstIdentifier.attribute. |
| 21 | +- Added more common fields to AST nodes. |
| 22 | +- Added argument 'leavesFirst' to traverseTree(). |
| 23 | +- Added argument 'attributeName' to newNode("identifier"). |
| 24 | +- Added argument 'updateTopNodePosition' to updateReferences(). |
| 25 | +- Added parser settings: printIds, printLocations, indentation, constantNameReplacementStringMaxLength. |
| 26 | +- Added parser constants: INT_SIZE, MAX_INT, MIN_INT. |
| 27 | +- Added internal fallback parser for string values so features added in later Lua versions are supported in all versions. |
| 28 | +- LuaJIT: Support numeral suffixes 'LL', 'ULL' and 'i'. |
| 29 | +Changed: |
| 30 | +- 'break' statements are allowed in the middle of blocks (according to Lua 5.2). |
| 31 | +- '-0' is no longer normalized to '0' in Lua 5.2 and earlier (except by simplify()) to match Lua's behavior. |
| 32 | +- newNode("label") and newNode("goto") now require a 'labelName' argument. |
| 33 | +- Renamed parse(path) function variant to parseFile(). |
| 34 | +- The path argument for parse(luaString) function variant is now optional. |
| 35 | +- Renamed tokenizeString() to tokenize() (to follow the same naming scheme as parse() and parseFile()). |
| 36 | +- toLua(): Improved string literal output. |
| 37 | +- toLua(): Integers gets outputted as integers (as opposed to floats with scientific notation) in more cases. |
| 38 | +- Updated "malformed number" error detection. |
| 39 | +- Parsing: Improved location information for blocks and functions. |
| 40 | +- Whitespace is no longer trimmed from comment tokens. |
| 41 | +- Improved error messages. |
| 42 | +Removed: |
| 43 | +- Removed functions: newTokenStream(), insertToken(), removeToken(). |
| 44 | +Fixed: |
| 45 | +- Fixed toLua() outputting expressions like '- -x' as '--x'. |
| 46 | +- Fixed printTokens() and printNode() printing unprintable/"bad" characters in strings. |
| 47 | +- Fixed the location in a syntax error message. |
| 48 | +- Fixed questionable handling of newlines in single-line comment tokens. |
| 49 | +Repository: |
| 50 | +- Added examples.lua. |
| 51 | + |
4 | 52 | v1.2.1 (2021-06-01) |
5 | 53 | - Fixed lookups and calls that shouldn't parse, like "":sub(). |
6 | 54 |
|
|
0 commit comments