mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-18 16:51:31 -07:00
Core library clean up: Make range expressions more consistent and replace uses of .. with ..=
This commit is contained in:
@@ -314,9 +314,9 @@ write_escaped_rune_writer :: proc(w: io.Writer, r: rune, quote: byte, html_safe
|
||||
is_printable :: proc(r: rune) -> bool {
|
||||
if r <= 0xff {
|
||||
switch r {
|
||||
case 0x20..0x7e:
|
||||
case 0x20..=0x7e:
|
||||
return true;
|
||||
case 0xa1..0xff: // ¡ through ÿ except for the soft hyphen
|
||||
case 0xa1..=0xff: // ¡ through ÿ except for the soft hyphen
|
||||
return r != 0xad; //
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,9 +85,9 @@ is_delimiter :: proc(c: rune) -> bool {
|
||||
is_separator :: proc(r: rune) -> bool {
|
||||
if r <= 0x7f {
|
||||
switch r {
|
||||
case '0'..'9': return false;
|
||||
case 'a'..'z': return false;
|
||||
case 'A'..'Z': return false;
|
||||
case '0'..='9': return false;
|
||||
case 'a'..='z': return false;
|
||||
case 'A'..='Z': return false;
|
||||
case '_': return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -104,7 +104,7 @@ equal_fold :: proc(u, v: string) -> bool {
|
||||
|
||||
if tr < utf8.RUNE_SELF {
|
||||
switch sr {
|
||||
case 'A'..'Z':
|
||||
case 'A'..='Z':
|
||||
if tr == (sr+'a')-'A' {
|
||||
continue loop;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user