Luaparser

Latest version: v3.3.0

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

3.3.0

What's Changed
* Updated Antlr4 grammar to use latest one (https://github.com/antlr/grammars-v4/tree/master/lua)
* Add support for Lua 5.4 attributes, new Node `Attribute`
* Build AST using antlr visitor instead of re-reading all tokens, should improve performance

Fixes
* Some comments were discarded 39
* Wrong operator precedence 38, 41, 33
* luaparser no longer works with python 3.13 58
* Failure to parse chained comparisons 56
* Some parser failures 49, 50

3.2.1

What's Changed
* `Statement` node is now a descendant of `Expression` node

Fixes
* Missing brackets on table 26
* Nested unary expressions 27
* Comments in the end of Node will be skipped 28
* Fail to reject unassigned global variable declaration 29
* Fail to reject an invalid escape sequence 30

3.1.1

What's Changed
* Fix lua ouput indenter by penguinol in https://github.com/boolangery/py-lua-parser/pull/25
* Feature/support pickling nodes by ypaliy-vdoo in https://github.com/boolangery/py-lua-parser/pull/20


**Full Changelog**: https://github.com/boolangery/py-lua-parser/compare/3.1.0...3.1.1

3.1.0

New feature

* each node now contains line infomation and start/stop token

python
class Node:
"""Base class for AST node."""
comments: Comments
first_token: Optional[Token]
last_token: Optional[Token]
start_char: Optional[int]
stop_char: Optional[int]
line: Optional[int]

3.0.1

Bug fixes

* fix 11: no visitor found for class StringDelimiter
* fix xml printer

3.0.0

Breaking changes

Index node
Index.idx use now a Name node instead of a String node:
Before: Index(idx=**String('a')**, value=Name('x'))
Now: Index(idx=**Name('a')**, value=Name('x'))

New features

* Index node: add notation property:

python
index_node.notation

class IndexNotation(Enum):
DOT = 0 obj.foo
SQUARE = 1 obj[foo]


* String node: add delimiter information

python
string_node.delimiter

class StringDelimiter(Enum):
SINGLE_QUOTE = 0 'foo'
DOUBLE_QUOTE = 1 "foo"
DOUBLE_SQUARE = 2 [[foo]]


* add a lua source printer

Fixes

* cant walk the ast tree in some cases.
* Merge pull request 7 from NanakiPL/master
* named an unnamed exception
* tests: add lua printer tests.

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.