| ... | ... | @@ -154,12 +154,8 @@ pub fn isAlpha(c: u8) bool { |
| 154 | 154 | return inTable(c, tIndex.Alpha); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | | pub fn isCtrl(c: u8) bool { |
| 158 | | return c < 0x20 or c == 127; //DEL |
| 159 | | } |
| 160 | | |
| 161 | 157 | pub fn isCntrl(c: u8) bool { |
| 162 | | return isCtrl(c); |
| 158 | return c < 0x20 or c == 127; //DEL |
| 163 | 159 | } |
| 164 | 160 | |
| 165 | 161 | pub fn isDigit(c: u8) bool { |
| ... | ... | @@ -204,7 +200,7 @@ pub fn isBlank(c: u8) bool { |
| 204 | 200 | |
| 205 | 201 | pub fn toUpper(c: u8) u8 { |
| 206 | 202 | if (isLower(c)) { |
| 207 | | return c - 0x20; |
| 203 | return c | ~0b00100000; |
| 208 | 204 | } else { |
| 209 | 205 | return c; |
| 210 | 206 | } |
| ... | ... | @@ -212,7 +208,7 @@ pub fn toUpper(c: u8) u8 { |
| 212 | 208 | |
| 213 | 209 | pub fn toLower(c: u8) u8 { |
| 214 | 210 | if (isUpper(c)) { |
| 215 | | return c + 0x20; |
| 211 | return c & 0b00100000; |
| 216 | 212 | } else { |
| 217 | 213 | return c; |
| 218 | 214 | } |