Releases: boolangery/py-lua-parser
Releases · boolangery/py-lua-parser
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
3.2.1
3.1.1
What's Changed
- Fix lua ouput indenter by @penguinol in #25
- Feature/support pickling nodes by @ypaliy-vdoo in #20
Full Changelog: 3.1.0...3.1.1
3.1.0
New feature
- each node now contains line infomation and start/stop token
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
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:
index_node.notation
class IndexNotation(Enum):
DOT = 0 # obj.foo
SQUARE = 1 # obj[foo]
- String node: add delimiter information
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.