Releases: z7zmey/php-parser
v0.8.0-rc.1
Merge pull request #117 from z7zmey/refactoring Refactoring
v0.7.2
v0.7.1
v0.7.0
v0.6.1
v0.6.0
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
#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
Enhancements:
- Error-tolerant parsing
- Possibility to parse files concurrently
- Saving all comments
- Saving comments position
Breaking changes:
- Removed
DocComment
andPlainComment
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 toPositionBuilder
scanner.CreateToken
returns pointerscanner.Token
saves position asposition.Position
Parser
interface moved toparser
packagetoken
package merged intoscanner
packagePositions
andComments
moved intoparser
package
Fixes:
- scanner: added
(binary)
cast - #28 fixed race conditions
- #18
heredocLabel
variable moved from global intoscanner.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 toscanner.Lexer.tokenString
v0.4.0
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
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
toWalkable
interface - Add
Names
interface - Add
dumper
andnamespace_resolver
tests