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

nimIdentNormalize removes spaces #18709

Closed
wants to merge 4 commits into from
Closed

Conversation

a-mr
Copy link
Contributor

@a-mr a-mr commented Aug 18, 2021

Just to conform to the compiler behavior.

runnableExamples:
doAssert nimIdentNormalize("Foo_bar") == "Foobar"
doAssert nimIdentNormalize("Foo Bar") == "Foobar"
Copy link
Member

Choose a reason for hiding this comment

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

This is dubios. The compiler only does it for backticks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, agree, changed that.

also rm backticks themseves
@Araq
Copy link
Member

Araq commented Aug 20, 2021

I still don't see the point, what's the benefit of this (it is a breaking change btw)?

@a-mr
Copy link
Contributor Author

a-mr commented Aug 20, 2021

For more correct treatment of backticked identifiers in #18642 .

The use cases are minor: so that a user could input RST link `number of items`_ and it would get resolved e.g. to Nim's const numberOfItems* while still being displayed with spaces in HTML.

@Araq
Copy link
Member

Araq commented Aug 20, 2021

Make the docgen use its own idea of nimIdentNormalize, I don't like breaking changes.

@a-mr
Copy link
Contributor Author

a-mr commented Aug 20, 2021

ok, you can close it, but note that it's not a breaking change anymore, it's a separate proc nimIdentBackticksNormalize

@a-mr
Copy link
Contributor Author

a-mr commented Aug 20, 2021

BTW i don't admit that it's "my own idea". I was amazed myself when realized that spaces between backticks are not significant:

proc fooBar(x: int): int = 3*x

echo $`foo bar`(3)

@Araq
Copy link
Member

Araq commented Aug 20, 2021

Why not move it to the docgen?

@a-mr a-mr closed this Aug 25, 2021
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