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

MatchData: implement specialized pretty_print #4574

Conversation

makenowjust
Copy link
Contributor

Regex::MatchData#inspect is overriding Struct#inspect and it have structural output, so I think pretty_print should be overriding also.

if i == 0
self[i].pretty_print pp
else
pp.text "#{name_table.fetch(i) { i }}:"
Copy link
Member

Choose a reason for hiding this comment

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

Just a minor thing, but fetch(i, i) would be easier to read

@mverzilli mverzilli merged commit 46e9d81 into crystal-lang:master Jun 16, 2017
@mverzilli mverzilli added this to the Next milestone Jun 16, 2017
@mverzilli
Copy link

Thank you!

@makenowjust makenowjust deleted the feature/regex-match-data/pretty-print branch June 16, 2017 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants