nitlang / nit

Nit language
http://nitlanguage.org
Apache License 2.0
239 stars 65 forks source link

lib/core: handling of plus (+) sign when using to_i with Text objects #2729

Closed dullin closed 5 years ago

dullin commented 5 years ago

While doing the Advent of Code 2018 in Nit, I encountered a file with numbers prefaced with a plus (+) sign. The to_i of Text wasn't able to handle that kind of input so I added it.

The PR add handling of prefacing + signs with the current - sign implementation. Also added the same logic to is_int so that assert can work. Added new tests in the documentation to show normal usage.

Signed-off-by: Hugo Leblanc dullin@hololink.org

lbajolet commented 5 years ago

Hi @dullin, thanks for the contribution!

I just have one nitpick regarding the commit message, it is common convention for commits in this repository to be prefixed with the unit it concerns, in your case that would be lib/core, if you could amend this, this would be a +1 for me

dullin commented 5 years ago

Fixed it, hadn't picked up on the convention, my bad.

xymus commented 5 years ago

Let's run the CI tests:

ok to test

xymus commented 5 years ago

The tests are OK, the failing tests are unrelated.