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

Finalize new API, more examples #1470

Merged
merged 2 commits into from
Aug 16, 2013
Merged

Conversation

DmitryOlshansky
Copy link
Member

The core part of pull #1225.
This neatly fixes issue 7260.

Basically everyone (me included) forgets to set the global flag in a regex foreach.
Coupled with the fact that splitter already cracks open regex to set global flag it's painfully obvious that global/local is an attribute of operation but not of the pattern itself.

Hence separate API calls, plus I use the opportunity to simplify the single match case to just get a range of submatches.

Also fixes issue 9579.

this()(R input, uint groups, NamedGroup[] named)
{
_input = input;
ngroup = groups;
Copy link
Member

Choose a reason for hiding this comment

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

We prefer members to start with _. That way incidentally make constructor writing easily because you can use the same name (without underscore) for parameters.

Copy link
Member Author

Choose a reason for hiding this comment

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

That way incidentally make constructor writing easily

... and everything else uglier. I'm still divided on this matter (as camn be seen in the source code, heh).
Anyway I'll make this struct consistently underscorish.

@andralex
Copy link
Member

fix the nits and let's get this in

@DmitryOlshansky
Copy link
Member Author

Done

andralex added a commit that referenced this pull request Aug 16, 2013
@andralex andralex merged commit b57c647 into dlang:master Aug 16, 2013
@DmitryOlshansky DmitryOlshansky deleted the regex-new-api-2 branch August 16, 2013 23:45
@DmitryOlshansky
Copy link
Member Author

Perfect.
@AndrejMitrovic I would love to add a line or two about this in the changelog, How should I go about it?
After all this new API that should gradually replace the global flag stuff.

@denis-sh
Copy link
Contributor

@blackwhale, matchFirst and matchAll has equal documentation. Fix please.

@DmitryOlshansky
Copy link
Member Author

@denis-sh Good catch, will do.

@ghost
Copy link

ghost commented Sep 10, 2013

@blackwhale

I would love to add a line or two about this in the changelog, How should I go about it?

The procedure is:

  1. Wait until the next beta release
  2. Use changed.d from the tools repo to generate the changelog listing all the bugs
  3. Hand-write any changes which should be more visible than others, especially things like breaking language changes.

So now we're at #1. Once we have a beta I'll begin working on the next changelog and I'll ping you for a description of this changeset.

@ghost
Copy link

ghost commented Oct 20, 2013

@blackwhale: If you can you could ping me with the examples of the API so I can put them in the changelog.

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

Successfully merging this pull request may close these issues.

3 participants