Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | fixes #8911 | Andreas Rumpf | 2018-09-16 | 1 | -7/+7 |
| | |||||
* | Fix too broad generic match for toHex (#8889) | LemonBoy | 2018-09-05 | 1 | -1/+1 |
| | | | Fixes #8865 | ||||
* | strutils: don't deprecate escape/unescape, too much code uses it | Araq | 2018-08-31 | 1 | -6/+2 |
| | |||||
* | Merge branch 'devel' into araq-misc | Araq | 2018-08-13 | 1 | -11/+20 |
|\ | |||||
| * | Fixed 7478: splitLines keepEol option (#8621) | Iván Montes | 2018-08-13 | 1 | -12/+21 |
| | | |||||
* | | fixes more nil string bugs | Araq | 2018-08-08 | 1 | -4/+6 |
| | | |||||
* | | strutils: minor code cleanup | Araq | 2018-08-08 | 1 | -4/+1 |
|/ | |||||
* | Testament should run tests with no action (#8232) | genotrance | 2018-07-08 | 1 | -3/+6 |
| | | | | | | * Testament should run tests with no action * Fix strutils tests for JS | ||||
* | Workaround VM bug in strutils | Dominik Picheta | 2018-06-17 | 1 | -2/+3 |
| | |||||
* | Exports unicode.toUpper/toLower in strutils module. | Dominik Picheta | 2018-06-17 | 1 | -0/+3 |
| | |||||
* | Add parse bin int, fixes #8018 (#8020) | Vindaar | 2018-06-13 | 1 | -39/+31 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 ` | ||||
* | Make isUpper (and variants) work for strings with non-alpha chars | Kaushal Modi | 2018-06-08 | 1 | -19/+62 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | fix handling of default precision in formatBiggestFloat for the js backend ↵ | skilchen | 2018-06-01 | 1 | -0/+7 |
| | | | | (#7928) | ||||
* | bugfix: strutils.find was broken for strings with uneven number of chars | Zahary Karadjov | 2018-05-07 | 1 | -248/+284 |
| | | | | | | | | | | | | For some reason, the problem was manifesting only inside the VM, it was detecting an attempt to read past the string end (i.e. the formerly accessible null byte). To catch such errors, strutils now performs static tests too. I've solved the problem by re-implementing the Boyer-Moore algotihm in a cleaner way and I took the opportunity to make some other optimisations to strutils. | ||||
* | make more tests green | Andreas Rumpf | 2018-04-30 | 1 | -1/+1 |
| | |||||
* | strutils: code cleanups and do not rely on the terminating binary zero anymore | Andreas Rumpf | 2018-04-28 | 1 | -289/+94 |
| | |||||
* | Don't escape multibyte characters (#7570) | Oscar Nihlgård | 2018-04-23 | 1 | -3/+14 |
| | |||||
* | remove dead code elimination option (#7669) | Jacek Sieka | 2018-04-23 | 1 | -1/+1 |
| | |||||
* | fixes #7507 | Araq | 2018-04-19 | 1 | -3/+11 |
| | |||||
* | move eqIdent to vm.nim (#7585) | Arne Döring | 2018-04-15 | 1 | -5/+6 |
| | | | | | | * Strutils comment changes. * fix typo | ||||
* | fixes #6205 | Andreas Rumpf | 2018-04-14 | 1 | -19/+19 |
| | |||||
* | FIXUP: Removed +1 causing substr slicing to skip chars on first iteration of ↵ | ryanc-signiq | 2018-03-08 | 1 | -1/+6 |
| | | | | while loop (#7312) | ||||
* | strutils.strip: improve the documentation; fixes #7159 | Andreas Rumpf | 2018-03-05 | 1 | -1/+3 |
| | |||||
* | fixes #7293 | Andreas Rumpf | 2018-03-05 | 1 | -3/+3 |
| | |||||
* | Merge pull request #6517 from FedericoCeratto/hexstr | Dominik Picheta | 2018-01-26 | 1 | -0/+50 |
|\ | | | | | Add string-to-hex and back conversions | ||||
| * | Add string-to-hex and back conversions | Federico Ceratto | 2017-11-27 | 1 | -0/+50 |
| | | | | | | | | Add parseHexStr and toHex and tests. | ||||
* | | Improved collection-to-string behavior (#6825) | Fabian Keller | 2017-12-14 | 1 | -20/+6 |
| | | |||||
* | | Fixes #4377. | Dominik Picheta | 2017-11-28 | 1 | -28/+46 |
| | | |||||
* | | cleaned up strutils.nim | Araq | 2017-11-28 | 1 | -17/+13 |
|/ | |||||
* | fixes system.runnableExamples; strutils makes use of runnableExamples | Araq | 2017-11-26 | 1 | -75/+66 |
| | |||||
* | fixes #6589 again (#6766) | Fabian Keller | 2017-11-17 | 1 | -3/+2 |
| | |||||
* | Modified handling of zero precision in formatFloat (#6719) | Fabian Keller | 2017-11-15 | 1 | -9/+12 |
| | |||||
* | added doc examples for formatFloat (#6704) | Fabian Keller | 2017-11-07 | 1 | -0/+10 |
| | |||||
* | Adds optional maxsplit parameter to splitWhitespace (#6503) (#6690) | olwi | 2017-11-06 | 1 | -15/+52 |
| | | | | | * Adds optional maxsplit parameter to splitWhitespace() (#6503) * Adds an example to splitWhitespace doc comment. Minor fixes to several doc comments | ||||
* | make tests green again | Araq | 2017-11-01 | 1 | -1/+2 |
| | |||||
* | Update `removeSuffix` implementations to match `removePrefix` (#6636) | Bo Lingen | 2017-10-30 | 1 | -27/+27 |
| | |||||
* | Merge branch 'devel' of github.com:nim-lang/Nim into devel | Andreas Rumpf | 2017-10-29 | 1 | -0/+11 |
|\ | |||||
| * | fixes #6589 (#6590) | Fabian Keller | 2017-10-29 | 1 | -0/+11 |
| | | |||||
* | | more replacements for the deprecated '<' | Andreas Rumpf | 2017-10-29 | 1 | -3/+3 |
|/ | |||||
* | add `strutils.removePrefix` proc (#6473) | Bo Lingen | 2017-10-28 | 1 | -2/+38 |
| | |||||
* | strutils.find enhancements (#6582) | Dmitry Atamanov | 2017-10-28 | 1 | -27/+49 |
| | |||||
* | isAlphaNumberic and isDigit improvement + tests (#6579) | Viktor Marosvary | 2017-10-24 | 1 | -2/+4 |
| | | | if we encounter a character that does not satisfy the proc, we return immediately, without continuing to loop over the rest of the chars in the string. | ||||
* | Fix `removeSuffix` rst code blocks | Silvio | 2017-10-23 | 1 | -0/+3 |
| | | | Add newline before `code-block` for `removeSuffix` | ||||
* | Merge pull request #6051 from couven92/alignLeft | Dominik Picheta | 2017-10-22 | 1 | -2/+29 |
|\ | | | | | Add left-aligning string proc to strutils | ||||
| * | Add safeties for alignLeft | Fredrik Høisæther Rasch | 2017-07-04 | 1 | -2/+2 |
| | | |||||
| * | Augment align proc with alignLeft proc | Fredrik Høisæther Rasch | 2017-07-04 | 1 | -2/+29 |
| | | |||||
* | | breaking change: arrays of char do not convert to cstring; ptr to array of ↵ | Andreas Rumpf | 2017-10-10 | 1 | -2/+8 |
| | | | | | | | | char does | ||||
* | | minor breacking change: in string formats '' the '1' is now interpreted as a ↵ | Andreas Rumpf | 2017-10-06 | 1 | -5/+21 |
| | | | | | | | | number, not as an identifier. This is more consistent with the rest of the mini language and allows '12'. | ||||
* | | in prepration for the upcoming different integer inference rules | Andreas Rumpf | 2017-09-16 | 1 | -1/+1 |
| | | |||||
* | | Fix wrong result of countLines() (#6371) | Simon Krauter | 2017-09-15 | 1 | -1/+2 |
| | |