Skip to content

v0.6.0

Choose a tag to compare

@jorgsowa jorgsowa released this 11 Apr 22:03
· 407 commits to main since this release
b05825c

What's new

Added

  • ScopeVisitor trait and ScopeWalker (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. ScopeWalker wraps any ScopeVisitor and maintains scope automatically across all PHP scope boundaries.

  • NameStr<'arena, 'src> (php-ast) — unified binding type for Variable and Identifier expression 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 emit VersionTooLow diagnostics 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/mixed in union positions, static readonly, and abstract final class (#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::Variable changed from Cow<'src, str> to NameStr<'arena, 'src>. Use .as_str() or Deref instead of .as_ref().
  • CommentMap and SymbolTable removed from php-ast; SourceMap moved to php-rs-parser and is now included in ParseResult::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