Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

2.0.0: New lambda syntax, namespaces and 5.3 closures

Compare
Choose a tag to compare
@thekid thekid released this 01 Mar 16:00
· 143 commits to master since this release

This release contains the following changes:

  • Made available via Composer (@thekid)
  • Heads up: Changed minimum XP version to run the XP compiler to XP
    6.0.0. It can still generated code to run on XP 5.X-SERIES, but will
    require 6.X-SERIES to run itself (@thekid)
  • Added possibility to add default values to lambda parameters. See
    #38 - (@thekid)
  • Fixed compiler choking on methods with generic return types (@thekid)
  • Allowed omitting the parameter type inside method declarations. The type
    will then be set to var and will be unchecked at runtime (@thekid)
  • Changed syntax for lambdas from #{ $a -> $a + 1 }; to $a -> $a + 1;,
    after resolving the grammar conflicts the former was avoiding. The old
    form is still supported but will raise compile-time warnings. It will be
    removed in the next major release.
    (@thekid)
  • Changed PHP 5.3 emitter to emit PHP 5.3 anonymous functions for lambdas
    (@thekid)
  • Merged pull request #37 to solve issue #36: Support "new T()", "T::const"
    and "T::$static" inside annotations - (@thekid)
  • Added backwards compatible emitter (-E php5.2) to create non-namespaced
    code for use with XP 5.8 and PHP 5.2 - (@thekid)
  • Changed default behaviour to creating namespaced code (compatible with
    XP 5.9 and PHP 5.3+) - (@thekid)
  • Changed "-E" command line argument to support versions: -E name will
    load xp.compiler.emit.name.Emitter, -E name60 will load the class
    xp.compiler.emit.name.V60Emitter - (@thekid)
  • Changed all emit*() methods in xp.compiler.emit.Emitter to protected
    (@thekid)