Skip to content

jextract: support Swift custom operators#829

Draft
AbdAlRahmanGad wants to merge 3 commits into
swiftlang:mainfrom
AbdAlRahmanGad:operators
Draft

jextract: support Swift custom operators#829
AbdAlRahmanGad wants to merge 3 commits into
swiftlang:mainfrom
AbdAlRahmanGad:operators

Conversation

@AbdAlRahmanGad

Copy link
Copy Markdown
Member

default:
return false
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good, yeap

return index == 0 ? name : name.firstCharacterUppercased
}
.joined()
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would be great to have a test for this, because e.g. we could have an operator ++++ which we'd like to then turn into plusPlusPlusPlus perhaps, so this is a "consume one operator, get the name, continue" operation.

Picking the known ones is good! but notice that knownOperatorNames[String(character)] wouldn't work for "==": "isEqual", or other known ones that have more characters.

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.

2 participants