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

Adds includes? macro method to string, symbol and macroid. #4025

Merged
merged 1 commit into from Feb 13, 2017
Merged

Adds includes? macro method to string, symbol and macroid. #4025

merged 1 commit into from Feb 13, 2017

Conversation

karlseguin
Copy link
Contributor

This is similar to the existing ends_with? and starts_with? macro methods.

case arg
when CharLiteral
piece = arg.value
when StringLiteral
Copy link
Contributor

Choose a reason for hiding this comment

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

If both CharLiteral and StringLiteral use the same code, why not combine both cases into one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took the code from the existing macro methods. starts_with?, ends_with? +, .. all do the same. Figured it was best to be consistent.

@asterite asterite changed the title Adds include? macro method to string, symbol and macroid. Adds includes? macro method to string, symbol and macroid. Feb 13, 2017
@spalladino spalladino added this to the 0.21.0 milestone Feb 13, 2017
@spalladino spalladino merged commit 6d4d49b into crystal-lang:master Feb 13, 2017
@karlseguin karlseguin deleted the feature/macro_includes branch February 17, 2017 14:01
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