Repository navigation
Conversation
Benchmark ResultsComparison of Open to see the benchmark results
Generated by phpbench against commit e8dcf5d |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #206.
CustomClassInjection::parse()removed the block delimiters with a globalstr_replace(), so as soon as a snippet contains one{:class:...:}block, every other:}in it is removed as well, and the tokens after it are rendered at the wrong position. For example:was rendered as
x = "{".format(y)andprint(x)x.The content is now built with
preg_replace_callback()on the same pattern, so only the delimiters of the matched blocks are removed. The offsets were already computed against the original string and do not change.Note: the example from the issue renders fine on
main(foosits at offset 34 of the input, not 33). The bug only shows up when the code itself contains a:}outside of a block, which is what the new test covers.