Repository navigation
Rewrite scanner and parser from re2c/lemon to PHP #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes are documented here. The format is based on [Keep a Changelog][keep_a_changelog] and this project adheres to [Semantic Versioning][semantic_versioning]. | ||
|
|
||
| ## [Unreleased](https://github.com/phalcon/volt/releases/tag/vx.x.x) (2026-xx-xx) | ||
|
|
||
| ### 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. | ||
|
|
||
| [keep_a_changelog]: https://keepachangelog.com/en/1.1.0/ | ||
| [semantic_versioning]: https://semver.org/spec/v2.0.0.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,14 @@ apt-get install -yq --no-install-recommends \ | |
| zip | ||
| # Dev/test extensions | ||
| install-php-extensions \ | ||
| phalcon-5.23.0 \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| xdebug | ||
| # ext-phalcon is the reference implementation for the parity scripts only | ||
| # (tests/generate-golden.php, tests/differential.php). It is not loaded by | ||
| # default so that the unit suite always exercises the pure-PHP parser. Load it | ||
| # on demand: | ||
| # php -d extension=phalcon tests/differential.php | ||
| rm -f /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini | ||
| # Locales | ||
| sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen | ||
| dpkg-reconfigure --frontend=noninteractive locales | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to add the version in a env variable