Releases: laytan/php-parser
Releases · laytan/php-parser
v0.10.0
v0.10.0 2023-17-04
Breaking Changes
- Changed VKCOM to laytan in imports and
go.mod
Added
ast.Typeenum andast.VertexGetType() ast.Typefunction for easily checking and storing vertex types- Expose the internal lexer using
lexer.New(src []byte, config conf.Config) (Lexer, error)
Fixes
- Added some boundary checks in the formatter to prevent some panics
- A newline will now be added after a doc comment in the printer
- Some fixes for start and end column addition in previous release
v0.9.0
Breaking Changes
- Dropped PHP 5 support to increase velocity/productivity
Added
- Nodes and tokens now also contain their StartCol and EndCol
- 2 new interfaces for traversers (backwards compatible):
traversers.CheckEntranceinterface: provides anEnterNode(ast.Vertex) boolthat, when implemented, is called before entering a node, allowing short circuiting and more control over the traversaltraversers.NotifyLeaveinterface: provides anLeaveNode(ast.Vertex)that, when implemented, is called when a node has fully been traversed, again allowing for more control
Fixes
- Fixed a bug where the parser would use token.DefaultBlockSize instead of position.DefaultBlockSize when instantiating the parser
Internals
- Rely on code generations for several repeating/boilerplate tasks
- Refactors and deduplication after PHP 5 removal
- Add golangci-lint configuration and an editorconfig file
Full Changelog: v0.8.3...v0.9.0
Memory fix/improvement
perf: reduce memory usage by reducing amt of position's created The positions created were taking GB's of memory and were not being GC'ed.