Parser does not detect invalid cast expressions
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
The issue names no file or test; begin by reproducing the PHP example and locating the parser entry point for cast expressions. Add a regression test covering comments between the parentheses, and confirm the parser reports the unexpected variable rather than creating a CastExpression.
Written by the indexing model from the issue text.
Description
Cast expressions may not contain anything except spaces and tabs between the parentheses.
In the following example, the parser generates a CastExpression while PHP sees it as a constant named 'int' followed by a variable.
Example:
<?php (/* hello */int)$a;
Actual result:
No error.
Expected result:
syntax error, unexpected $a (T_VARIABLE)
- Dominant language
- PHP
- Stars
- 894
- Forks
- 85
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 2
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/tolerant-php-parser
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/tolerant-php-parser#423 ·
-
New release requestOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/tolerant-php-parser#420 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
microsoft/tolerant-php-parser#417 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
microsoft/tolerant-php-parser#413 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/tolerant-php-parser#407 · 2 comments ·
All issues in microsoft/tolerant-php-parser
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
[Sync EN] Fix session read handler docs: false reports a failure, not a missing session (#5902)Opensync-en
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[Sync EN] Fix session read handler docs: false reports a failure, not a missing session (#5902)Opensync-en
Difficulty 2/5 1-2 days Newbie friendliness 84/100
Maintainers usually reply within 2 days
-
feature-request needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-sdk-php#3365 ·
Maintainers usually reply within 1 day