Skip to content

v1.0.0

Latest

Choose a tag to compare

@niden niden released this 20 Nov 00:32
· 2 commits to 1.0.x since this release
52b752a

Changed

  • The scanner and the parser are written by hand instead of being transliterated from cphalcon's re2c scanner and Lemon parser; resources/files/parser.php and the global phvolt_* functions are gone.
  • Phalcon\Volt\Parser\Parser::setDebug() and setDebugFile() are deprecated; the debug file now receives a shift/reduce trace.
  • Phalcon\Volt\Scanner\State and Phalcon\Volt\Scanner\Token only hold scanner state; Phalcon\Volt\Scanner\Opcode and Phalcon\Volt\Parser\Status were removed.

Added

  • Parity tests against ext-phalcon: a template corpus with goldens recorded from cphalcon (tests/generate-golden.php), FixturesTest, and tests/differential.php, run in CI.

Fixed

Parsing now matches cphalcon exactly. Previously:

  • syntax errors showed the previous token's value, and dropped empty, "0" or blank values: unexpected token ~(id) instead of unexpected token ~;
  • scanning errors quoted one character instead of the rest of the template;
  • deeply nested templates were accepted instead of failing with "Parsing failed, the template expression is nested too deeply";
  • blank text between the blocks of a child template was kept instead of dropped;
  • a NUL byte did not end the template;
  • {# 0 #} ended the template.