Make parseutils.parseBin|Oct|Hex generic (#11067)

* make parsutils.parseBin generic and improve runnableExamples
* reimplement parseBin/Oct/Hex and improve runnableExamples
* update changelog.md file with parseBin/Oct/Hex and fix a typo
This commit is contained in:
Alvydas Vitkauskas 2019-04-24 18:26:01 +03:00 • committed by Andreas Rumpf
commit ae2923e5de
2 changed files with 137 additions and 86 deletions

View file

@ -47,11 +47,17 @@
- `system.ValueError` now inherits from `system.CatchableError` instead of `system.Defect`.
- The procs `parseutils.parseBiggsetInt`, `parseutils.parseInt`,
- The procs `parseutils.parseBiggestInt`, `parseutils.parseInt`,
`parseutils.parseBiggestUInt` and `parseutils.parseUInt` now raise a
`ValueError` when the parsed integer is outside of the valid range.
Previously they sometimes raised a `OverflowError` and sometimes returned `0`.
- The procs `parseutils.parseBin`, `parseutils.parseOct` and `parseutils.parseHex`
were not clearing their `var` parameter `number` and used to push its value to
the left when storing the parsed string into it. Now they always set the value
of the parameter to `0` before storing the result of the parsing, unless the
string to parse is not valid and then the value of `number` is not changed.
- `streams.StreamObject` now restricts its fields to only raise `system.Defect`,
`system.IOError` and `system.OSError`.
This change only affects custom stream implementations.