-
Notifications
You must be signed in to change notification settings - Fork 27
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
Rename mro not to overlap with Python keyword #188
Conversation
src/Nirum/Targets/Python.hs
Outdated
toEnumMemberName :: Name -> T.Text | ||
toEnumMemberName name' = if attributeName `elem` memberKeywords | ||
then T.snoc attributeName '_' | ||
else attributeName |
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.
Incorrect indentation.
src/Nirum/Targets/Python.hs
Outdated
toEnumMemberName name' = if attributeName `elem` memberKeywords | ||
then T.snoc attributeName '_' | ||
else attributeName | ||
where |
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 where
doesn't have to be nested.
src/Nirum/Targets/Python.hs
Outdated
memberKeywords = ["mro"] | ||
toEnumMemberName :: Name -> T.Text | ||
toEnumMemberName name' = if attributeName `elem` memberKeywords | ||
then T.snoc attributeName '_' |
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.
How about making T.snoc
an infix operator?
Fix #185.
Add
_
at the end of member name when it is duplicated with Python keyword (eg.mro
).