Skip to content

Releases: z7zmey/php-parser

v0.8.0-rc.1

29 Dec 19:35
4d6130d
Compare
Choose a tag to compare
v0.8.0-rc.1 Pre-release
Pre-release
Merge pull request #117 from z7zmey/refactoring

Refactoring

v0.7.2

26 Jul 17:25
cbf185c
Compare
Choose a tag to compare

[#105] Fix counting newlines in strings
[#110] Fix JSON dumper
[#109] Do not override Stmts in printNodeRoot()
[#111] NamespaceResolver: Resolve PHP 7.4 class property types

v0.7.1

14 Jun 20:45
ee48d84
Compare
Choose a tag to compare

[#107] fix infinite loop when $ appear between variable and the end of a template string

v0.7.0

09 Mar 12:44
Compare
Choose a tag to compare

[#82] PHP 7.4
[#93] Wrong line number when parsing string
[#91] Scanner doesn't support \x80-\xff identifiers
[#86] JsonDumper don't work
[#78] Print echo
[#80] Ragel based lexer

v0.6.1

20 Aug 19:15
Compare
Choose a tag to compare

#96 handle lexer errors

v0.6.0

25 Feb 16:26
d07e234
Compare
Choose a tag to compare

new

golang/json dumper
saving and printing free-floating comments and whitespaces

nodes

attribute StringVar was removed from expr.Variable
node stmt.Die was removed, added Die attribute to stmt.Exit instead

optimizations

save position within node
use sync.Pool to reuse scanner.Token

bugfix

__halt_compiler(); terminates parsing process
accept backslash+newline in single quotes
fixed /*/ comment termination
fixed crash on an empty list item, missed items are represented by empty *expr.ArrayItem

v0.5.1

03 Jul 09:10
Compare
Choose a tag to compare

#44: if array item list ends by a comma, last nil does not removed
#44: fixed crash on an empty list item
#41: Namespace resolver now does not resolve build-in primitives
Fixed bug: Namespace resolver fails when TraitUse does not contain adaptations
#40: memory allocations reduced for position.Position by using sync.Pool
#27: memory allocations reduced for scanner.Token by using sync.Pool
#26: TrimLeft replaced by TrimLeftFunc (small optimization)
#38: fixed saving positions for php5 ArrayDimFetch, PropertyFetch and MethodCall nodes
#34: fixed saving position for Class node

v0.5.0

07 Jun 17:35
9f0d4b0
Compare
Choose a tag to compare

Enhancements:

  • Error-tolerant parsing
  • Possibility to parse files concurrently
  • Saving all comments
  • Saving comments position

Breaking changes:

  • Removed DocComment and PlainComment types
  • Removed boolWithToken, altSintaxNode, nodesWithEndToken types
  • Created node.Root, node.ArgumentList, stmt.TraitAdaptationList, stmt.CaseList, stmt.ClassExtends, stmt.ClassImplements, stmt.InterfaceExtends, expr.Reference nodes
  • Changed ClosureUse node purpose, now it represents variables list instead of wrapping the variable
  • Builder was renamed to PositionBuilder
  • scanner.CreateToken returns pointer
  • scanner.Token saves position as position.Position
  • Parser interface moved to parser package
  • token package merged into scanner package
  • Positions and Comments moved into parser package

Fixes:

  • scanner: added (binary) cast
  • #28 fixed race conditions
  • #18 heredocLabel variable moved from global into scanner.Lexer
  • fixed panic on 32-bit systems
  • fixed bug when scanning an empty inline comment
  • fixed namespace resolver fail on anonymous class
  • fixed the saving non-latin comments

Optimisations:

  • #21 refactored scanner.Lexer.charsToBytes and renamed to scanner.Lexer.tokenString

v0.4.0

06 Apr 12:26
624dc4f
Compare
Choose a tag to compare

Created simple pretty printer
Created Heredoc node
Fixed Heredoc scanning
Fixed template strings and backquoted strings scanning
Dumper now writes to io.writer
Removed redundant nop before InlineHtml
Renamed assign.AssignRef to assign.Reference
Renamed cast nodes, remove Cast prefix

v0.3.0

01 Mar 21:06
Compare
Choose a tag to compare

Namespace resolver

Namespace resolver is a visitor that traverses nodes and resolves name nodes as fully qualified names.
It does not change AST but collects resolved names into map[node.Node]string

For Class, Interface, Trait, Function, ConstList nodes collects name with current namespace.
For Name, Relative, 'FullyQualified' nodes resolves use aliases and collects a fully qualified name.

Other changes

  • Remove the underscore from package names
  • Fix goreportcard.com warnings
  • Rename Walker to Walkable interface
  • Add Names interface
  • Add dumper and namespace_resolver tests