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