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

fixes #23513, parseutils.nim: parseInt's doc example. #23561

Open
wants to merge 6 commits into
base: devel
Choose a base branch
from

Conversation

litlighilit
Copy link
Contributor

@litlighilit litlighilit commented May 2, 2024

fixes #23513

Also, the old runnableExample is just a copy of proc parseInt(openArray[char], var int, int) variant (in Line 1000).

litlighilit and others added 3 commits May 2, 2024 15:37
Its doc used to render wrongly where `>` is considered as quote block.
Also, the old `runnableExample` is just a copy of `proc parseInt(openArray[char], var int, int)` variant (in Line 1000).
Comment on lines +477 to +478
doAssert parseInt("-2024_05_02", res) == 11
doAssert res == -20240502
Copy link
Member

Choose a reason for hiding this comment

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

You also need to add doc comments that parseInt in parseutils and strutils accept signs and underscores

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 find...

  • Any procedure that's related to parse some integers handles underline _ (e.g. parseOct/parseHex 1 )
  • parseInt parseBiggestInt handles leading sign character +/-.

Footnotes

  1. This is reflected in their runnableExamples

@litlighilit
Copy link
Contributor Author

litlighilit commented May 9, 2024

I find...

  • Any procedure that's related to parse some integers handles underline _ (e.g. parseOct/parseHex 1 )
  • parseInt parseBiggestInt handles leading sign character +/-.

Mentioned in here

I think we shall either:

  • Mention what they can handle in their doc comments
  • Or just reflect these in runnableExamples as they used to do.

Footnotes

  1. This is reflected in their runnableExamples

@litlighilit
Copy link
Contributor Author

  • Or just reflect these in runnableExamples as they used to do.

Currently I've added examples for all parseInt/parseBiggestInt variants in std/parseutils

@litlighilit
Copy link
Contributor Author

ping @ringabout

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.

parseInt accepts more than digits
2 participants