Merge: lib/core: handling of plus (+) sign when using to_i with Text objects
authorJean Privat <jean@pryen.org>
Mon, 18 Feb 2019 16:25:04 +0000 (11:25 -0500)
committerJean Privat <jean@pryen.org>
Mon, 18 Feb 2019 16:25:04 +0000 (11:25 -0500)
commit629f403e0ab2c138405ac3580a45e427bcd31ae0
tree7b2e7f0e02e0816e5a0f2d85c4166b48b9b828bc
parent6ae755781daf2fd07287fdb52160af3808bbd2eb
parent971c23bea5fcfbc92a485c772e3db14ee23dfcaa
Merge: lib/core: handling of plus (+) sign when using to_i with Text objects

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>

Pull-Request: #2729
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>