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

Refine inline parsing #560

Merged
merged 5 commits into from
Oct 3, 2020
Merged

Refine inline parsing #560

merged 5 commits into from
Oct 3, 2020

Conversation

colinodell
Copy link
Member

This takes the changes from #550 and #551 to the next level 😉

Based on @MarkCarver's feedback, we're removing the string $match parameter from InlineParserInterface::parse() and instead exposing the matches via the context. This also now includes sub-matches from regex capturing groups.

Instead of passing in a `string $match` parameter, we've undone that
BC-break and instead expose match information via the context. This
approach gives us some flexibility and makes it easier for developers to
use the already-known match data to avoid expense regex matching of
their own.
@colinodell colinodell added this to the v2.0 milestone Oct 3, 2020
@colinodell colinodell added enhancement New functionality or behavior performance Something could be made faster or more efficient labels Oct 3, 2020
@colinodell colinodell merged commit dcbb7ec into latest Oct 3, 2020
@colinodell colinodell deleted the refine-inline-parsing branch October 3, 2020 14:58
'symbol' => '@',
'regex' => '/^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}(?!\w)/',
'prefix' => '@',
'regex' => '[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}(?!\w)',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we still including a prefix? Shouldn't this just be part of the regex now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality or behavior performance Something could be made faster or more efficient
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants