Merge: to_i behaviour coherent with parser
authorJean Privat <jean@pryen.org>
Mon, 3 Aug 2015 18:35:17 +0000 (14:35 -0400)
committerJean Privat <jean@pryen.org>
Mon, 3 Aug 2015 18:35:17 +0000 (14:35 -0400)
commitdec9932ac708c0380e769e94266b60241a1b28a9
tree5e9d473ad2d1d455bbbc3e066633f00eaf332cf5
parent8313dff25fddc2c3d47b280c51b2d917cd48d9a6
parenta38c0c8b181749cf73f82cf6409b8137008ac6f0
Merge: to_i behaviour coherent with parser

This PR changes the behaviour of `to_i` in Strings to support all the derivatives from the parser (hex, bin, oct and underscores)

The change in behaviour helps clean a bit of literal, though some more factorization is yet to come.

As for perfs, on Valgrind (`nitg src/nitg.nit`)

* Before : 14 289 384 832 Ir

* After : 14 348 036 981 Ir

A little slowdown, but acceptable imho since the function accepts more valid inputs and is safer.

Pull-Request: #1602
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>