Releases: mattacosta/php-parser
Releases · mattacosta/php-parser
v1.0.0-beta.7
[email protected] (2020-06-05)
Added
- Emulation of PHP's workaround for tokenizing UTF-8 and UTF-16 text.
- A static
from
method to create aPhpParserOptions
object from a generic configuration object.
Changed
ISourceText
now includes anencoding
property.SourceTextFactory.from()
now has an optionalencoding
parameter.PhpSyntaxTree.fromText()
now has an optionalencoding
parameter.IndirectVariable
andLocalVariable
now use separate visitor methods.
Fixed
- A possible exception when finding tokens in the last node of a long list.
- Incorrect state when parsing an interpolated string that is immediately followed by another string.
SyntaxWalker
no longer throws an exception when only walking nodes.
v1.0.0-beta.6
[email protected] (2019-09-12)
Added
- PHP 7.4 features:
- Null coalescing assignments.
- Spread operators in arrays.
- Arrow functions.
- Typed properties.
- Numeric literal separators.
Changed
- PHP 7.4 changes:
- The
(real)
type cast now generates a deprecation warning. - Open tags are now valid at the end of files.
- The
- The
UseElement
propertyname
has been renamed totarget
. - Line breaks are no longer included in
SingleLineComment
tokens. - Unexpected characters now generate
Error
tokens instead ofUnknown
tokens. - The
BackQuoteTemplate
token has been renamed toShellCommandTemplate
. - The
NewLine
token has been renamed toLineBreak
.
Fixed
- Incorrect state after tokenizing interpolations with close tags.
- Incorrect state after tokenizing interpolations with #-style comments.
- Interpolations with trailing trivia no longer generate corrupt syntax trees.
- Invalid unicode escape sequences now have the correct diagnostic width.
TextSpan
objects should no longer contain offsets before the starting position.- Interpolations with invalid hex/bin offsets should not generate
0x
or0b
tokens.
v1.0.0-beta.5
[email protected] (2019-05-04)
Added
- Feature availability diagnostics are now reported when the required language
version is not met.
Changed
- Improved diagnostics in many cases where other tokens are possible.
ISyntaxNode
now has anisMissing
property.PhpParserOptions
now includes adocumentationMode
property (currently not
implemented).PhpParserOptions
now has individual properties for each feature.
Fixed
- Duplicate diagnostic on interfaces with
var
properties. - Trait adaptations with a method reference that uses a relative name are no
longer parsed incorrectly. TraitUseGroupSyntaxNode
andIncompleteMemberSyntaxNode
should inherit from
StatementSyntaxNode
.
Removed
ISyntaxNode
no longer requires methods to get descendants.
v1.0.0-beta.4
[email protected] (2018-08-30)
Added
- PHP 7.3 features.
- Trailing commas in argument lists.
- Byref assignment in list deconstructions.
- Flexible heredocs.
- A static
formatMessage()
method toErrorCodeInfo
for convenience.
Changed
- The token used by
<>
is no longer shared with!=
. - The token used by
die
is no longer shared withexit
. ISyntaxNode
now has afindChildToken()
method.
Fixed
- An exception when tokenizing an interpolated string that was missing certain paired characters.
- An exception when tokenizing an unexpected character at the end of a file.
- The
yield from
token should no longer partially match identifiers that start with "from". - Invocation expressions with relative names such as
namespace\foo()
are no longer parsed incorrectly.
v1.0.0-beta.3
[email protected] (2018-06-04)
Added
- Functions with reserved names can now be parsed using the
allowReservedNames
option. SyntaxToken
now implements a staticgetText()
method.
Changed
- Type cast aliases are now separate, unique tokens.
ISourceText
now implementsIEquatable
.ISourceText
now has awithChanges()
method.
Fixed
- Short open tags should be parsed as echo statements.
- Abstract syntax nodes should declare their own abstract properties instead of deferring to implementations.
v1.0.0-beta.2
[email protected] (2018-02-28)
Added
PhpParser
now accepts a parameter for additional options.
Changed
ISyntaxNode
now includes ahasError
property.PhpSyntaxTree
now has a public constructor.
Fixed
- A long value with an exponent should be tokenized as a double.
v1.0.0-beta.1
[email protected] (2017-11-25)
Initial release.