Skip to content
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

Tokenizer/PHP: add tests for heredoc/nowdoc tokenization #584

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jul 31, 2024

Description

The PHP tokenizer contains logic to:

  • Retokenize the start/end tokens for nowdocs from T_(START|END)_HEREDOC to T_(START|END)_NOWDOC;
  • Retokenize the contents of a heredoc/nowdoc to T_HEREDOC/T_NOWDOC tokens.
  • Retokenize the start token from T_START_(HERE|NOW)DOC to T_STRING if the heredoc/nowdoc is unclosed;
  • Ensure that each line in the contents has its own token.

This commit adds tests safeguarding and documenting this part of the tokenizer.

Suggested changelog entry

N/A

The PHP tokenizer contains logic to:
* Retokenize the start/end tokens for nowdocs from `T_(START|END)_HEREDOC` to `T_(START|END)_NOWDOC`;
* Retokenize the _contents_ of a heredoc/nowdoc to `T_HEREDOC`/`T_NOWDOC` tokens.
* Retokenize the start token from `T_START_(HERE|NOW)DOC` to `T_STRING` if the heredoc/nowdoc is unclosed;
* Ensure that each line in the contents has its own token.

This commit adds tests safeguarding and documenting this part of the tokenizer.
@jrfnl jrfnl added this to the 3.10.x Next milestone Jul 31, 2024
@jrfnl jrfnl merged commit e5c46d3 into master Jul 31, 2024
50 checks passed
@jrfnl jrfnl deleted the feature/tokenizer-php-add-tests-heredoc-nowdoc branch July 31, 2024 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant