summary refs log tree commit diff stats
path: root/compiler/renderer.nim
diff options
context:
space:
mode:
authorKaushal Modi <kaushal.modi@gmail.com>2018-06-06 17:44:11 -0400
committerKaushal Modi <kaushal.modi@gmail.com>2018-06-08 15:14:29 -0400
commit24df909d8a953f2b7ba0e0d1adf3a256042cd9bc (patch)
tree8ee5c50bf6084fa1c60a3c29f8601946230666d2 /compiler/renderer.nim
parent3e799d7876110d970c365d61c05e887729488e2f (diff)
downloadNim-24df909d8a953f2b7ba0e0d1adf3a256042cd9bc.tar.gz
Make isUpper (and variants) work for strings with non-alpha chars
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.
Diffstat (limited to 'compiler/renderer.nim')
0 files changed, 0 insertions, 0 deletions
cs/ranger/commit/README?h=v1.6.0&id=7dc8fef89688b92ff03ec8005e57286751d0c539'>7dc8fef8 ^
4833bc23 ^

4ea0f69a ^

240394a4 ^

712aa449
240394a4 ^

240394a4 ^
7dc8fef8 ^
9e89f023 ^
36e4e71e ^
20ab9343 ^

20ab9343 ^





4ea0f69a ^

240394a4 ^
7dc8fef8 ^
36e4e71e ^

4a383291 ^
78a7d762 ^
e952d6cb ^
78a7d762 ^
e952d6cb ^
4ea0f69a ^

7838675f ^

07069888 ^

07069888 ^
7838675f ^

1891697f ^
755e7df1 ^
a3d5f44b ^
66a8d4ff ^
7838675f ^
7dc8fef8 ^
80a93f0b ^
500cf259 ^

7dc8fef8 ^


80a93f0b ^
240394a4 ^



240394a4 ^
7dc8fef8 ^
240394a4 ^




7dc8fef8 ^
240394a4 ^



e5fb3d74 ^
240394a4 ^

240394a4 ^
7dc8fef8 ^



7b33b517 ^

176e8a68 ^
7b33b517 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99