Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: laytan/php-parser

v0.10.0

16 Apr 23:38

Choose a tag to compare

v0.10.0 2023-17-04

Breaking Changes

  • Changed VKCOM to laytan in imports and go.mod

Added

  • ast.Type enum and ast.Vertex GetType() ast.Type function 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

26 Mar 01:15

Choose a tag to compare

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.CheckEntrance interface: provides an EnterNode(ast.Vertex) bool that, when implemented, is called before entering a node, allowing short circuiting and more control over the traversal
    • traversers.NotifyLeave interface: provides an LeaveNode(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

08 Sep 22:46

Choose a tag to compare

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.