Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fixes #6255 - removed regex for token parsing #6286

Closed
wants to merge 6 commits into from

Conversation

steverhoades
Copy link
Contributor

It appears that the regex expression is unreliable, I have added a token parsing mechanism in it's place. Please let me know if there are any test cases that we should add to this.

@steverhoades
Copy link
Contributor Author

Hm, there appears to be some issues with PHP 5.5 and 5.6. I'll need to investigate this further..

@Ocramius
Copy link
Member

@steverhoades switching to tokenizer-based reads is absolutely a plus - still didn't have time to look over it though. I obviously see a lot of space for edge cases (as usual)

@steverhoades
Copy link
Contributor Author

@Ocramius agreed. I'd like to get as many of those edge cases covered if possible. I can see there are missing token checks for newer PHP versions that will need to be added as well.

Let me know what you come up with when you have time and I'll make sure and get them covered.

@steverhoades
Copy link
Contributor Author

Weirdness with travis? unrelated test is failing -

@Ocramius
Copy link
Member

@steverhoades yes, that test fails randomly and is very annoying :\

@Ocramius
Copy link
Member

I'm marking this for 2.4, as the code changes are quite large (switching from regex to token parser will likely have funny consequences)

@Ocramius Ocramius self-assigned this May 20, 2014
@Ocramius Ocramius added this to the 2.4.0 milestone May 20, 2014
@Ocramius
Copy link
Member

See #6255

return $cacheKey;
}

// //TODO - would it be better to define the binding like this?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steverhoades any plans for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ocramius No, that is included as part of the test actually. It's not meant to be an actual TODO. Perhaps I should have referenced the issue from which I used to create the test case :(

Essentially it's testing that the Reflection class properly handles comment parsing. For instance in this case, it should ignore the __prototype function as it's commented out.

@weierophinney weierophinney modified the milestones: 2.4.0, 2.3.2 Aug 6, 2014
@weierophinney
Copy link
Member

Scheduling for 2.3.2, as this is technically a bugfix.

Ocramius added a commit that referenced this pull request Aug 6, 2014
@Ocramius Ocramius closed this in 4e87ff6 Aug 6, 2014
@Ocramius
Copy link
Member

Ocramius commented Aug 6, 2014

Rebased/merged manually. Thanks @steverhoades, this one is quite an improvement!

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.

3 participants