mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-30 04:29:15 +01:00
Update changelog, fix typos
This commit is contained in:
parent
648800f07f
commit
659d26c231
10
CHANGELOG.md
10
CHANGELOG.md
@ -5,20 +5,20 @@ Version 1.3.0-dev
|
|||||||
|
|
||||||
* Errors can now store the attributes of the node/token where the error occurred. Previously only the start line was
|
* Errors can now store the attributes of the node/token where the error occurred. Previously only the start line was
|
||||||
stored.
|
stored.
|
||||||
* If file positions are enabled in the lexer, errors can now provide column information if it is available.
|
* If file positions are enabled in the lexer, errors can now provide column information if it is available. See
|
||||||
TODO/link
|
[documentation](https://github.com/nikic/PHP-Parser/blob/master/doc/component/Error.markdown#column-information).
|
||||||
* The parser now provides an experimental error recovery mode, which can be enabled by disabling the `throwOnError`
|
* The parser now provides an experimental error recovery mode, which can be enabled by disabling the `throwOnError`
|
||||||
parser option. In this mode the parser will try to construct a partial AST even if the code is not valid PHP.
|
parser option. In this mode the parser will try to construct a partial AST even if the code is not valid PHP. See
|
||||||
TODO/link
|
[documentation](https://github.com/nikic/PHP-Parser/blob/master/doc/component/Error.markdown#error-recovery).
|
||||||
* Added support for PHP 7 `yield from` expression. It is represented by `Expr\YieldFrom`.
|
* Added support for PHP 7 `yield from` expression. It is represented by `Expr\YieldFrom`.
|
||||||
* Added support for PHP 7 anonymous classes. These are represented by ordinary `Stmt\Class_` nodes with the name set to
|
* Added support for PHP 7 anonymous classes. These are represented by ordinary `Stmt\Class_` nodes with the name set to
|
||||||
`null`. Furthermore this implies that `Expr\New_` can now contain a `Stmt\Class_` in its `class` subnode.
|
`null`. Furthermore this implies that `Expr\New_` can now contain a `Stmt\Class_` in its `class` subnode.
|
||||||
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* Fixed registration of PHP 7 aliases, for the case where the old name was used before the new name.
|
* Fixed registration of PHP 7 aliases, for the case where the old name was used before the new name.
|
||||||
* Fixed handling of precedence when pretty-printing `print` expressions.
|
* Fixed handling of precedence when pretty-printing `print` expressions.
|
||||||
|
* Floating point numbers are now pretty-printed with a higher precision.
|
||||||
* Checks for special class names like `self` are now case-insensitive.
|
* Checks for special class names like `self` are now case-insensitive.
|
||||||
|
|
||||||
Version 1.2.2 (2015-04-03)
|
Version 1.2.2 (2015-04-03)
|
||||||
|
@ -27,7 +27,7 @@ try {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Before using column information it's availability needs to be checked with `$e->hasColumnInfo()`, as the precise
|
Before using column information its availability needs to be checked with `$e->hasColumnInfo()`, as the precise
|
||||||
location of an error cannot always be determined. The methods for retrieving column information also have to be passed
|
location of an error cannot always be determined. The methods for retrieving column information also have to be passed
|
||||||
the source code of the parsed file. An example for printing an error:
|
the source code of the parsed file. An example for printing an error:
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ if ($e->hasColumnInfo()) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Both line numbers and column numbers are 1-based. EOF errors will be positioned at the position one past the end of the
|
Both line numbers and column numbers are 1-based. EOF errors will be located at the position one past the end of the
|
||||||
file.
|
file.
|
||||||
|
|
||||||
Error recovery
|
Error recovery
|
||||||
@ -48,9 +48,8 @@ Error recovery
|
|||||||
|
|
||||||
> **EXPERIMENTAL**
|
> **EXPERIMENTAL**
|
||||||
|
|
||||||
By default the parser will stop throw an exception upon encountering the first error during parsing. The parser also
|
By default the parser will throw an exception upon encountering the first error during parsing. An alternative mode is
|
||||||
supports an alternative mode, in which the parser will remember the error, but try to continue parsing the rest of the
|
also supported, in which the parser will remember the error, but try to continue parsing the rest of the source code.
|
||||||
source code.
|
|
||||||
|
|
||||||
To enable this mode the `throwOnError` parser option needs to be disabled. Any errors that occurred during parsing can
|
To enable this mode the `throwOnError` parser option needs to be disabled. Any errors that occurred during parsing can
|
||||||
then be retrieved using `$parser->getErrors()`. The `$parser->parse()` method will either return a partial syntax tree
|
then be retrieved using `$parser->getErrors()`. The `$parser->parse()` method will either return a partial syntax tree
|
||||||
|
Loading…
Reference in New Issue
Block a user