summary refs log tree commit diff stats
path: root/lib/pure/unicode.nim
Commit message (Collapse)AuthorAgeFilesLines
* Update unicode.nim: cmpRunesIgnoreCase: fix doc format (#23560)lit2024-05-021-6/+6
| | | | | | Its doc used to render wrongly where `>` is considered as quote block: ![image](https://github.com/nim-lang/Nim/assets/97860435/4aeda257-3231-42a5-9dd9-0052950a160e)
* Change unicode lookup tables to have int32 elements to support platforms ↵Gianmarco2024-03-251-1/+1
| | | | | | | | | | | | | | | where sizeof(int) < 4 (#23433) Fixes an issue that comes up when using strutils.`%` or any other strutils/strformat feature that uses the unicode lookup tables behind the scenes, on systems where ints are than 32-bit wide. Tested with: ```bash ./koch test cat lib ``` Refer to the discussion in #23125.
* Fix cmpRunesIgnoreCase on system where sizeof(int) < 4. Fixes #23125. (#23138)Gianmarco2023-12-281-1/+6
| | | | | | | Fixes an issue where importing the `strutils` module, or any other importing the `strutils` module, ends up with a compile time error on platforms where ints are less then 32-bit wide. The fix follows the suggestions made in #23125.
* fixes SSL version check logic [backport] (#21324)ringabout2023-02-021-1/+1
| | | | | | | | | | | | | | | | | | | * fixed version check logic [backport] * add ciphersuites * debug nimble * fixes returns omission * finally * remove debug message * add ciphersuites --------- Co-authored-by: Araq <rumpf_a@web.de>
* Added openarray[char] overloads to std/unicode (#20648)Jason Beetham2022-10-271-46/+417
| | | | | | | | | | | | | | | | | * Added openarray[char] overloads to std/unicode Call substr instead of index slice inside unicode Added substr overload for openarray for parity with string functionality Made style checker happies and fixed overloads for substr * Added update to changelog [skip ci] * Inline unicode string operations * Moved substr overload to unicode Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #18858 [backport] (#18868)Andreas Rumpf2021-09-191-1/+4
| | | | | | | * fixes #18858 [backport] * ensure async tests work with --experimental:strictEffects [backport] * ensure async tests work with --experimental:strictEffects [backport]
* fixes #17768 [backport:1.4] (#18317)flywind2021-06-211-6/+4
| | | | | * fixes #17768 [backport:1.4] * tiny
* Fix unicode.split with seperators examples (#17176)zetashift2021-02-261-58/+25
| | | | | | | | | | | | | | | | | | | | | | * Fix unicode.split with seperators examples https://nim-lang.org/docs/unicode.html#split.i%2Cstring%2CRune%2Cint didn't work with the set constructor `{}` so replaced it with a string that's converted to an openArray compatible type containing `Rune`s. * Add runnableExamples to unicode.split * Add runnableExamples to split with single separator too * Simplify runnableExamples unicode.split * Improve the rest of the runnableExamples with the simplified code * Simplify runnableExamples of unicode.split even more * Formatted unicode.split example * Update lib/pure/unicode.nim Co-authored-by: zetashift <rishi2@laptop.localdomain> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* Fix broken links in docs (#16336)Elliot Waite2020-12-141-1/+1
| | | | | * Fix broken links in docs * Fix rand HSlice links
* move tests to testament (#16101)flywind2020-11-241-216/+0
| | | | | | | | | * move tests to testament * minor * fix random * disable test random
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-0/+1
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* Remove deprecated stuff from stdlib (#14699)Miran2020-06-171-82/+0
| | | | | | | * update to the latest Jester * remove deprecated procs from some stdlib modules * 'criterion' is not maintained anymore and relies on obsolete stuff
* Remove the uses of {.procvar.} pragma (#14359)Kaushal Modi2020-05-151-18/+18
| | | | | | | This pragma did nothing. Ref: - https://github.com/nim-lang/Nim/issues/2172#issuecomment-383276469 - https://github.com/nim-lang/Nim/issues/12975
* unicode: minor documention improvementAraq2020-04-201-0/+1
|
* Deprecate DCE:on (#13839)Juan Carlos2020-04-021-3/+0
|
* unicode.split: Fix the splitting when a Rune separator is used [backport] ↵Kaushal Modi2020-03-121-14/+11
| | | | | | | | | | (#13629) * unicode.split: Fix the splitting when a Rune separator is used [backport] - Fixes https://github.com/nim-lang/Nim/issues/13628 - Ref https://irclogs.nim-lang.org/11-03-2020.html#20:01:34 * unicode.split: Remove the sepLen based logic.. resulted in wrong jumps
* sink parameter inference for types that have destructors (#13544)Andreas Rumpf2020-03-041-1/+1
| | | | | | | | | | | | | | * ensure capitalize doesn't take an inferred sink parameter * sink parameter inference: first version, for now disabled. Changed that sink parameters can be consumed multiple times in order to adhere to our spec. * sink inference can now be disabled with .nosinks; sometimes for proc type interop this is required * fixes yet another critical DFA bug * better implementation that also understands if expressions etc * document sink parameter inference and allow for global disabling
* Fix for 16 bit platforms (#12760) [backend]PMunch2019-11-281-6/+6
| | | | | This fixes some tiny issues with using Nim on 16-bit platforms. Not entirely sure why the AVR chip I was compiling for with "cpu = avr" was detected as 16-bit, but that's probably another issue..
* [backport] run nimpretty on string stuffnarimiran2019-09-301-33/+34
|
* remove unicode.Rune16 without deprecation period; fixes ↵Andreas Rumpf2019-08-281-5/+0
| | | | https://github.com/nim-lang/RFCs/issues/151 (#12072)
* unicode.nim: fixed spacing to something saneAndreas Rumpf2019-08-261-1/+1
|
* [bugfix] Make std/unicode compile with --styleCheck:error (#11763)Kaushal Modi2019-07-171-3/+3
|
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-51/+51
| | | | --styleCheck:error
* right shift is now by default sign preserving (#11322)Arne Döring2019-05-291-66/+66
| | | | | | | | | | | * right shift is now by default sign preserving * fix hashString and semfold * enable arithmetic shift right globally for CI * fix typo * remove xxx * use oldShiftRight as flag * apply feedback * add changelog entry
* fix changing case for Unicode characters which change size (#11271)Miran2019-05-201-9/+16
| | | | Some Unicode characters don't have the same byte length in their upper- and lower-case variants.
* update unicode.nim (#10921)Miran2019-03-311-1148/+383
| | | | | | | | | | * update unicode.nim * create a script to create the needed unicode data * make unicode.nim compatible with Unicode v12.0.0 * slightly improve unicode.nim documentation (fixes #4795) * more documentation
* [backport] improve unicode docs, fixes #2353 (#10174)Miran2019-01-041-85/+122
| | | | | | | | * as instructed in #2353, provides a short description why there are no specialized procs for seq[Rune] * adds several examples to better explain what some functions do * small fixes (double backticks, add missing dots, etc.) * use `rune` instead of "unicode characer"
* fixes #9800 (#9804) [backport]pgkos2018-11-261-2/+5
| | | | | * fixes #9800 * add tests for #9800
* Fixed wording (#9761)Yuriy Glukhov2018-11-201-4/+4
|
* removes deprecated T/P typesAraq2018-11-161-2/+0
|
* WIPArne Döring2018-11-081-1/+6
|
* unicode.nim: minor alignment changeAraq2018-11-021-6/+6
|
* unicode: added strip, align, alignLeft, repeat procs; refs #6301Andreas Rumpf2018-10-141-0/+149
|
* unicode: add split procs; refs #6301Andreas Rumpf2018-10-141-0/+176
|
* strutils/unicode: deprecate isLower and friends operating on complete ↵Andreas Rumpf2018-10-141-40/+7
| | | | strings; fixes #7963 properly
* Make isUpper (and variants) work for strings with non-alpha charsKaushal Modi2018-06-081-30/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* keep unicode.nim warning freeAraq2018-05-181-4/+4
|
* remove dead code elimination option (#7669)Jacek Sieka2018-04-231-1/+1
|
* Fixes #6223.Dominik Picheta2017-11-281-6/+6
|
* Little spelling fix in unicode moduleDominik Picheta2017-10-151-1/+1
|
* system/unicode: check for buffer overflows; refs #5284Araq2017-02-081-25/+47
|
* update stdlib to not use deprecated symbolsAndreas Rumpf2016-08-251-3/+3
|
* Added iterator for utf8 stringsHans Raaf2016-07-131-1/+15
|
* Add useful unicode procs for string manipulationJoey Payne2016-07-011-0/+134
| | | | | | | Added: isUpper, isLower, isAlpha, isWhiteSpace, toUpper, toLower, and capitalize Renamed strutils procs that are similar to avoid conflicts
* Add new procs for string manipulationJoey Payne2016-06-131-29/+209
| | | | | Add center, isTitle, title, partition, rpartition, rsplit, swapCase, translate, and expandTabs
* Optimized end offsets and added tests.Hans Raaf2016-06-021-12/+93
| | | | | | I hope this also shows that there are use cases. I still think the user should get warned about performance issues with those procs, which I added to the doc comments.
* More work in optimizing, names and added substr().Hans Raaf2016-06-021-6/+40
| | | | | This is work in progress. I added an unicode substring. Tried to handle edgecases more consistent too.
* Some procs to deal with Rune position base indexing.Hans Raaf2016-06-021-0/+19
| | | | | It can't be perfect but at least one can index on rune position efficiently.
* change 'Rune' type in unicode module to 'int32'Parashurama2016-06-021-2/+2
|
* validateUtf8: catch overlong asciitheduke2015-11-261-0/+1
| | | Make unicode.validateUtf8() check for overlong ascii representations, which are 2 bytes long and start with c0 or c1.