summary refs log tree commit diff stats
path: root/lib/pure
Commit message (Collapse)AuthorAgeFilesLines
* Add styledWrite macroKaushal Modi2018-06-181-12/+74
| | | | | | | | | | | Also: - Move the tests block to the end of the file - Fix the older tests - Add tests for existing styledEcho - Add new tests for styledWrite Fixes https://github.com/nim-lang/Nim/issues/8046.
* Add support for italic and strikethrough ANSI escape codes (#8048)Kaushal Modi2018-06-171-3/+6
| | | | | | | \e[3m -> italic \e[9m -> strikethrough On terminals not supporting italic text, the text is shown in reverse instead, and on terminals not supporting strikethrough text, the text is shown as is.
* Add MemMapFileStream. Fixes in memFiles. (#7944)Dmitry Atamanov2018-06-141-9/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add MemMapFileStream * Added tests * Fixed bug in memfiles (zero index for string) * Added flush to changelog * Attempt to fix Win's nuances * Fix attempt to fix * Continue... * And again... * Reworked tests (all for win on Win) * Fixes in flush (Win) * Replace fn vars to consts * Added the attempts parameter to the flush * Replace while to for * Move to memfiles * Use Natural instead of uint * Better error messages for append mode. Handle specific cases.
* Merge pull request #7950 from Paalon/math-logAndreas Rumpf2018-06-141-5/+15
|\ | | | | Add log for base b of x
| * Fix a testKoki Fushimi2018-06-141-1/+1
| |
| * Use one same type for two parametersKoki Fushimi2018-06-141-5/+1
| |
| * Use concrete expressionKoki Fushimi2018-06-051-7/+6
| |
| * Bug fixKoki Fushimi2018-06-051-2/+3
| |
| * Change to use log(x, base)Koki Fushimi2018-06-051-3/+3
| |
| * Broaden the argument typesKoki Fushimi2018-06-041-1/+6
| |
| * Generalize and add testKoki Fushimi2018-06-041-7/+14
| |
| * Add log proc for base b of xKoki Fushimi2018-06-041-1/+3
| |
* | Update marshal.nimFederico Ceratto2018-06-131-0/+1
| |
* | Add hint on JSON serializationFederico Ceratto2018-06-131-0/+1
| |
* | Add parse bin int, fixes #8018 (#8020)Vindaar2018-06-132-51/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 `
* | fixes merge conflictAraq2018-06-111-1/+1
|\ \
| * | Added FileMode to comment on asyncfile openAsync (#8008)Jimmie Houchin2018-06-111-1/+1
| | |
* | | fixes merge conflictAndreas Rumpf2018-06-117-60/+189
|\| |
| * | Merge pull request #7873 from ehmry/GenodeEnvAndreas Rumpf2018-06-092-4/+6
| |\ \ | | | | | | | | Native access to Genode environment
| | * | Native access to Genode environmentEmery Hemingway2018-06-072-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a 'GenodeEnv' type and a 'componentConstructHook' to the system module. The 'componentConstructHook' allows for detection of POSIX style programs that exit implicitly or native Genode components that initialize to serve RPC requests and OS signals. This hook takes a 'GenodeEnv' argument so that the environment interface is passed cleanly to application code after globals are initialized. This is an typed pointer to a C++ object, procedures for accessing the environment will be available from a Nimble library and not included in the standard library. The standard library has an internal pointer to the environment object but this is not for external use, the undocumented global environment pointer has been removed.
| * | | Merge pull request #8001 from kaushalmodi/fix-isupper-islower-try2Andreas Rumpf2018-06-092-49/+146
| |\ \ \ | | | | | | | | | | Make isUpper (and variants) work for strings with non-alpha chars
| | * | | Make isUpper (and variants) work for strings with non-alpha charsKaushal Modi2018-06-082-49/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The other variants are isLower, isUpperAscii and isLowerAscii Fixes https://github.com/nim-lang/Nim/issues/7963. This commit changes the behavior and signatures of: - isUpper, isLower in the unicode module - isUpperAscii, isLowerAscii in the strutils module A second mandatory parameter skipNonAlpha is added to these 4 procs. (This change affects only for the case where the input is a *string*.) --- With skipNonAlpha set to true, the behavior mimics the Python isupper and islower behavior i.e. non-alphabetic chars/runes are ignored when checking if the string is upper-case or lower-case. Before this commit: doAssert(not isUpper("A B")) After this commit: doAssert(not isUpper("A B", false)) <-- old behavior doAssert isUpper("A B", true) Below two are equivalent: isUpper("A B", true) isAlpha("A B") and isUpper("A B", false) .. and the similar for other 3 procs.
| * | | | Change parseEnum to something faster for method parsing in asynchttpserver ↵hlaaf2018-06-081-2/+15
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#7682) * Add faster method parsing to asynchttpserver * Make it readable * Align case statement
| * | | Removed redundant conditions in CritBitTree.inc, speedup it.data-man2018-06-081-4/+1
| | | |
| * | | Add the val parameter for CritBitTree[T].incl (#7988)Dmitry Atamanov2018-06-081-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | * Add the val parameter for CritBitTree[T].incl * Updated changelog
| * | | Fixed compilation error when Sockaddr_in4 or Sockaddr_in6 passed to fromSockAddrYuriy Glukhov2018-06-071-1/+1
| | | |
* | | | fixex merge conflictsAraq2018-06-088-179/+121
|\| | |
| * | | Fixed bug in CritBitTree.inc. Fixes #7990.data-man2018-06-071-1/+10
| | | |
| * | | Quote a keys for CritBitTree $ impl. Fixes #7987data-man2018-06-071-4/+8
| | | |
| * | | Merge pull request #7806 from survivorm/feature/times_mutatorsAndreas Rumpf2018-06-071-37/+22
| |\ \ \ | | | | | | | | | | Feature/times mutators
| | * | | [change] Replace mutators with their more generic versionsMichael Voronin2018-06-061-37/+22
| | | | |
| * | | | Fix one more place.cheatfate2018-06-071-1/+1
| | | | |
| * | | | Fix fromSockAddrAux() to handle IPv6 addresses properly.cheatfate2018-06-071-9/+16
| | | | |
| * | | | Merge pull request #7822 from data-man/fix_2753Andreas Rumpf2018-06-071-1/+1
| |\ \ \ \ | | |_|/ / | |/| | | Fixes #2753
| | * | | Merge branch 'devel' of https://github.com/nim-lang/Nim into fix_2753data-man2018-05-196-520/+586
| | |\ \ \
| | * | | | Fixes #2753data-man2018-05-141-1/+1
| | | | | |
| * | | | | Rip out the `try` transformation in the async macro.Dominik Picheta2018-06-061-105/+6
| | | | | |
| * | | | | Allow `%` overloading in `%*` macro in json (again)hlaaf2018-06-061-4/+4
| | | | | |
| * | | | | Rename tgamma to gamma (#7929)Koki Fushimi2018-06-051-3/+10
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rename tgamma to gamma * set the deprecating version 0.19.0 * update changelog and use description in deprecated pragma
| * | | | Fix strformat neg zero (#7954)skilchen2018-06-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix strformat handling of neg zero with sign * better tests for neg zero with sign * use inplace insertion of the sign as suggested by Varriount
| * | | | Fix strformat precision handling for strings (#7941)skilchen2018-06-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix strformat precision handling for strings * add some limited unicode awareness to the precision handling for strings * improvement suggested by Varriount: use setLen and runeOffset instead of runeSubstr
| * | | | Add product proc (#7951)Koki Fushimi2018-06-041-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add product proc * Update changelog
| * | | | Use higher time resolution when available in os.nim (#7709)Oscar Nihlgård2018-06-041-12/+20
| | |_|/ | |/| |
* | | | fixed merge conflictAndreas Rumpf2018-06-049-303/+758
|\| | |
| * | | fix handling of default precision in formatBiggestFloat for the js backend ↵skilchen2018-06-011-0/+7
| | | | | | | | | | | | | | | | (#7928)
| * | | fix strformat zeropadding for floats (#7934)skilchen2018-06-011-2/+20
| | | |
| * | | Add imaginary unit. (#7922)Koki Fushimi2018-06-011-0/+4
| | | |
| * | | Support `div`, `mod`, floorDiv and floorMod for Rationals (#7918)Koki Fushimi2018-06-011-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support `div`, `mod`, floorDiv and floorMod for Ratinoals. * Bug fix and add tests. * Update changelog
| * | | Merge branch 'feature/times_fixup' of https://github.com/survivorm/Nim into ↵Dominik Picheta2018-05-311-218/+503
| |\ \ \ | | | | | | | | | | | | | | | survivorm-feature/times_fixup
| | * | | [add] Add fraction of seconds to parse/format utilsMichael Voronin2018-05-311-60/+75
| | | | |