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)
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>


Trivial merge