v0.6.0
What's new
Added
-
ScopeVisitortrait andScopeWalker(php-ast) — zero-allocation scope-aware AST traversal. Every visit method receives a&Scope<'src>with the current namespace, class name, and function/method name.ScopeWalkerwraps anyScopeVisitorand maintains scope automatically across all PHP scope boundaries. -
NameStr<'arena, 'src>(php-ast) — unified binding type forVariableandIdentifierexpression nodes. Zero-copy for source-borrowed names; arena-owned for synthesised names. -
PhpVersion::Php74(php-rs-parser) — PHP 7.4 target added. Deprecated casts ((real),(unset)) now emitVersionTooLowdiagnostics when targeting PHP 8.0+. -
PHPDoc continuation lines (
php-rs-parser) — tag descriptions accumulate indented continuation lines, matching PHPStan/Psalm behaviour.
Fixed
- Panic on string slice at non-char boundary in the lexer (#139)
- Unterminated string literals now emit a proper diagnostic instead of silently producing a malformed AST (#133)
- Missing version gates for deprecated casts and PHP 8.x-only constructs (#131)
- Reject
void/never/mixedin union positions,static readonly, andabstract finalclass (#130) - Chained non-associative operators and bare ternary chains in PHP 8 mode (#129)
- PHP version not threaded through the interpolation sub-parser (#128)
Breaking changes
ExprKind::Variablechanged fromCow<'src, str>toNameStr<'arena, 'src>. Use.as_str()orDerefinstead of.as_ref().CommentMapandSymbolTableremoved fromphp-ast;SourceMapmoved tophp-rs-parserand is now included inParseResult::source_map.
crates.io
| Crate | Version |
|---|---|
| php-ast | 0.6.0 |
| php-lexer | 0.6.0 |
| php-rs-parser | 0.6.0 |
| php-printer | 0.6.0 |