Files
vercel-labs--zerolang/std/ascii.0
T
wehub-resource-sync e7738de6d2
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
chore: import upstream snapshot with attribution
2026-07-13 12:29:30 +08:00

62 lines
1.5 KiB
Plaintext

fn __zero_std_ascii_is_digit(byte: u8) -> Bool {
return byte >= 48_u8 && byte <= 57_u8
}
fn __zero_std_ascii_is_lower(byte: u8) -> Bool {
return byte >= 97_u8 && byte <= 122_u8
}
fn __zero_std_ascii_is_upper(byte: u8) -> Bool {
return byte >= 65_u8 && byte <= 90_u8
}
fn __zero_std_ascii_is_alpha(byte: u8) -> Bool {
return __zero_std_ascii_is_lower(byte) || __zero_std_ascii_is_upper(byte)
}
fn __zero_std_ascii_is_alnum(byte: u8) -> Bool {
return __zero_std_ascii_is_alpha(byte) || __zero_std_ascii_is_digit(byte)
}
fn __zero_std_ascii_is_whitespace(byte: u8) -> Bool {
return byte == 32_u8 || byte == 9_u8 || byte == 10_u8 || byte == 13_u8
}
fn __zero_std_ascii_is_hex_digit(byte: u8) -> Bool {
return __zero_std_ascii_is_digit(byte) || (byte >= 65_u8 && byte <= 70_u8) || (byte >= 97_u8 && byte <= 102_u8)
}
fn __zero_std_ascii_to_lower(byte: u8) -> u8 {
if __zero_std_ascii_is_upper(byte) {
return byte + 32_u8
}
return byte
}
fn __zero_std_ascii_to_upper(byte: u8) -> u8 {
if __zero_std_ascii_is_lower(byte) {
return byte - 32_u8
}
return byte
}
fn __zero_std_ascii_digit_value(byte: u8) -> Maybe<u8> {
if __zero_std_ascii_is_digit(byte) {
return byte - 48_u8
}
return null
}
fn __zero_std_ascii_hex_value(byte: u8) -> Maybe<u8> {
if __zero_std_ascii_is_digit(byte) {
return byte - 48_u8
}
if byte >= 65_u8 && byte <= 70_u8 {
return byte - 55_u8
}
if byte >= 97_u8 && byte <= 102_u8 {
return byte - 87_u8
}
return null
}