Nim/lib
Vindaar e80be6173d Add parse bin int, fixes #8018 (#8020)
* clarify `parseHexInt`, `parseOctInt` docstring and exception msgs

* add `parseBinInt` based on `parseutil.parseBin` implementation

Adds a `parseBinInt`, which parses a binary integer string and returns
it as an integer. This is based on the implementation of
`parseutil.parseBin`, removing the unnecessary parts.

* add tests for all `parse(Hex|Oct|Bin)Int` procs

* replace `parse*Int` proc impls by call to parseutil procs

Replaces the `parse(Hex|Oct|Bin)Int` procedure implementation by calls
to the `parseutil` procs, which receive a mutable argument.

Has the main advantage that the empty string as well as a "prefix
only" string, e.g. "0x" counts as an invalid integer.

Also moves the `parseOctInt` proc further up in the file so that all
`parse` procs are below one another.

* replace `var L` by `let L` in `parse` procs

There's no reason for the usage of `var` here.

* add `maxLen` optional arg for `parseutil.parse(Oct|Bin)`

Plus small change to test cases.

* update changelog about `parse*Int` procs

* fix `rejectParse` template in `tstrutils`

* make sure only `s.len` chars are parsed, if `maxLen+start` > s.len

Fixes a previous bug in `parseHex` (and now affected `parseOct` and
`parseBin`), which allowed to set `start + maxLen` to be larger than
the strings length. This resulted in an out of bounds access.

* move `parse*Int` proc change to breaking changes, add double `
2018-06-13 13:32:12 -04:00
..
arch/x86 Coroutine rework. 2017-02-20 17:24:19 +02:00
core WIP: an API for VM replay global state support 2018-06-03 20:18:43 +02:00
deprecated remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
genode Native access to Genode environment 2018-06-07 07:21:20 +02:00
genode_cpp Native access to Genode environment 2018-06-07 07:21:20 +02:00
impure Fix typo: PRCE -> PCRE 2018-06-05 12:58:23 -04:00
js Adds TextAreaElement type. 2018-05-14 13:03:18 +02:00
packages fixex merge conflicts 2018-06-08 19:50:36 +02:00
posix Use higher time resolution when available in os.nim (#7709) 2018-06-04 14:56:56 +02:00
pure Add parse bin int, fixes #8018 (#8020) 2018-06-13 13:32:12 -04:00
std Add note to import "std/sha1" to sha1.nim (doc) 2018-06-01 16:20:30 +02:00
system fixes merge conflict 2018-06-11 01:25:48 +02:00
windows remove dead code elimination option (#7669) 2018-04-23 11:02:38 +02:00
wrappers Set Genode Openssl shared-object strings 2018-06-07 07:21:31 +02:00
cycle.h Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
nimbase.h Native access to Genode environment 2018-06-07 07:21:20 +02:00
nimrtl.nim lib: Trim .nim files trailing whitespace 2015-09-04 23:03:56 +02:00
nimrtl.nim.cfg Rename *.nimrod.cfg to *.nim.cfg 2015-02-03 09:04:24 +01:00
prelude.nim Nimrod renamed to Nim 2014-08-28 09:59:26 +02:00
stdlib.nimble attempt to make the build green again 2017-01-07 02:55:15 +01:00
system.nim Native access to Genode environment 2018-06-07 07:21:20 +02:00