Skip to content

Releases: zephir-lang/php-zephir-parser

v2.0.2

28 May 22:39

Choose a tag to compare

Added

  • Added grammar rules for variadic parameters (...name and type ...name). The parameter AST node now carries a "variadic" => 1 flag so the compiler can generate variadic functions/methods
    (zephir-lang/zephir#2025).

v2.0.1

18 May 15:56
bd6e282

Choose a tag to compare

Added

  • Added grammar rule for <static> cast and method return type. STATIC is a reserved keyword token, so <static> never reached the existing LESS IDENTIFIER GREATER cast rule and was rejected as a syntax error. A dedicated LESS STATIC GREATER production now emits the literal "static" string in the same AST shape that <self> (and any other <IDENTIFIER> cast) produces, so the downstream compiler picks it up with no further parser-level changes. Enables public function foo() -> <static> for late-static-binding return types in Zephir
    (zephir-lang/zephir#2505).

v2.0.0

05 Apr 21:11

Choose a tag to compare

Added

  • Added support for array destructuring assignment syntax let [a, b, c] = expr;,
    matching PHP 7.1+ short list convention. Supports skipped slots (let [a, , c] = arr;)
    and all-caps variable names. Parser-only; compiler code generation tracked in
    zephir#2496
    (#18)
  • Added docs/grammar.ebnf containing the complete Zephir grammar in EBNF notation
    for railroad diagram visualization via bottlecaps.de/rr/ui
    (#106)

Fixed

  • All-uppercase identifiers (e.g. RBF, LU, A) are now accepted as class names,
    method names, function names, variable names, property names, and parameters.
    Previously the scanner emitted XX_T_CONSTANT for any all-caps token and grammar
    rules for name positions only accepted XX_T_IDENTIFIER, causing a syntax error
    (#39,
    #180).
  • Class properties, constants, and methods can now be declared in any order inside a
    class body. Previously only 9 fixed orderings were accepted; interleaving them (e.g.
    a constant after a property) caused a ParseException
    (#26,
    #181).
  • (uchar) cast expressions no longer emit "unknown type" into the AST. The missing
    XX_TYPE_UCHAR case has been added to xx_ret_type() in parser/parser.h
    (#82,
    #182).
  • String literals are now accepted as the method name in dynamic static method calls
    (self::{"name"}(), ClassName::{"method"}(args), static::{"name"}()). Previously
    only IDENTIFIER was accepted in that position while xx_mcall_expr already
    supported STRING
    (#22,
    #183).
  • The ~ (bitwise-NOT) operator no longer conflicts with the ~"…" interned-string
    literal (ISTRING) token. The re2c longest-match rule always resolved this correctly,
    but the disambiguation is now documented with an explanatory comment in scanner.re
    and covered by regression tests
    (#23,
    #184).

v1.8.0

28 Sep 13:57

Choose a tag to compare

Added

  • Enabled PHP 8.5 support #160
  • Added full support for object variable declaration #37
  • Added support for single letter classes #166

v1.7.0

23 Nov 14:26
7da0962

Choose a tag to compare

Added

v1.6.1

03 Jun 20:14
3e92337

Choose a tag to compare

Fixed

  • Fix lcov coverage #151

v1.6.0

27 Aug 17:30
5ecdbcd

Choose a tag to compare

Added

  • Enabled support of PHP8.3 for PECL #141

v1.5.3

08 Feb 21:46
d94a53a

Choose a tag to compare

Added

  • Enabled Thread Safe (TS) builds #145

v1.5.2

27 Dec 22:06
5431c3d

Choose a tag to compare

Added

  • Enabled support of PHP8.2 for Windows #141

v1.5.1

19 Sep 11:32
bb5df17

Choose a tag to compare

Added

  • Enabled support of PHP8.2 for PECL #141