Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Disambiguate PHP shortform ternary #100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jeffrafter
Copy link

This should fix #56

The current PHP parsing did not support short from ternary (?:) with an immediate token such as true or false following it. I copied the ruleset from https://github.com/facebook/hhvm/blob/master/hphp/parser/hphp.ll#L515 (except for the maybe states) and tried to implement a better lookahead.

I am not sure I did this in the correct/most efficient way and welcome comments/suggestions.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@jeffrafter
Copy link
Author

I realize this is a PR for an issue that was brought up over a year ago but I am using this as a trial 🎈 to better understand the code base. I was hoping for comments and feedback so I can begin digging into some larger issues. Thanks!

@phooji
Copy link
Contributor

phooji commented Feb 26, 2015

@jeffrafter @aryx It's been a while. Should we merge this?

@aryx
Copy link
Contributor

aryx commented Feb 26, 2015

Can you rebase on a more recent version. Apparently we can't automatically merge your request.

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong parsing of short form of ternary if with no spaces $rows?:false;
4 participants