Skip to content

Conversation

@jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jan 18, 2022

Follow up on #3478.

When an enum would be backed by a type and the colon would directly follow the name of the enum, the name would be incorrectly tokenized (including the colon) as T_GOTO_LABEL.

Discovered while reviewing #3482

Also related to #3161

/cc @kukulich


Tests/BackfillEnum: update token calculations

... after the bugfix for T_GOTO_LABEL.

Also added a minor tweak to one test case to make sure that spacing around the type colon is handled correctly.

…OTO_LABEL

Follow up on 3478.

When an `enum` would be backed by a type and the colon would directly follow the name of the `enum`, the name would be incorrectly tokenized (including the colon) as `T_GOTO_LABEL`.

Discovered while reviewing 3482

Also related to 3161
@jrfnl jrfnl force-pushed the php8.1/tokenizer-php-bugfix-enum-name-vs-goto-label branch from 5a2df66 to bb03390 Compare January 18, 2022 15:47
... after the bugfix for `T_GOTO_LABEL`.

Also added a minor tweak to one test case to make sure that spacing around the type colon is handled correctly.
@jrfnl
Copy link
Contributor Author

jrfnl commented Feb 10, 2022

@gsherwood Could this PR please be milestoned to 3.7.0 ?

@gsherwood gsherwood added this to the 3.7.0 milestone Feb 10, 2022
@gsherwood gsherwood changed the title PHP 8.1 | Tokenizer/PHP: bugfix - name of typed enum tokenized as T_GOTO_LABEL Name of typed enum tokenized as T_GOTO_LABEL Feb 14, 2022
gsherwood added a commit that referenced this pull request Feb 14, 2022
@gsherwood gsherwood merged commit 718b932 into squizlabs:master Feb 14, 2022
@gsherwood
Copy link
Member

Thanks for finding and fixing this.

@jrfnl jrfnl deleted the php8.1/tokenizer-php-bugfix-enum-name-vs-goto-label branch February 14, 2022 23:47
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.

2 participants