-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Macro map_with_index
#8049
Macro map_with_index
#8049
Conversation
Could you please separate reorganization and feature addition into separate commits (or maybe even PRs)? Thanks! |
@straight-shoota I'll make another PR with the reorganization plus implementing the missing specs. This should be good to review now. |
src/compiler/crystal/macros.cr
Outdated
@@ -422,6 +422,10 @@ module Crystal::Macros | |||
def gsub(regex : RegexLiteral, replacement : StringLiteral) : StringLiteral | |||
end | |||
|
|||
# Returns a `StringLiteral` where all `:` are replaced with `_`. | |||
def identify : StringLiteral |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be another PR?
What is the |
@RX14 No idea, it already exists but just wasn't documented. |
Bump, this should be good to go. |
@RX14 @bcardiff @straight-shoota Any chance of this making it in the next release? |
Anything left to do here? |
This needs to be washed into two commits, one focused on adding |
fe4e009
to
f1a4c25
Compare
f1a4c25
to
72d4899
Compare
@straight-shoota Done. Just made one commit with the changes. Can make another PR later for adding that macro method to the doc list. |
Yes, please. It should be a separate commit, either in this PR or in another one. |
map_with_index
method onTupleLiteral
andArrayLiteral
.Reorganizes the macro method specs a bitAlphabetizes each typeUse the constant type vs stringUpdates some type's structure to use the standard formatMainly justTupleLiteral
andArrayLiteral
.Marks some missing tests as pendingCan make another PR later to fill these in.Reorganization will be handled in another PR.
Use case is something like (pseudo code):