5 | public export %inline
10 | public export %inline
15 | public export %inline
20 | public export %inline
25 | public export %inline
30 | public export %inline
35 | public export %inline
40 | public export %inline
45 | public export %inline
50 | public export %inline
55 | public export %inline
60 | public export %inline
65 | public export %inline
70 | public export %inline
75 | public export %inline
80 | public export %inline
85 | public export %inline
90 | public export %inline
95 | public export %inline
100 | public export %inline
105 | public export %inline
110 | public export %inline
115 | public export %inline
120 | public export %inline
125 | public export %inline
130 | public export %inline
135 | public export %inline
140 | public export %inline
145 | public export %inline
150 | public export %inline
155 | public export %inline
160 | public export %inline
165 | public export %inline
170 | public export %inline
175 | public export %inline
180 | public export %inline
185 | public export %inline
190 | public export %inline
195 | public export %inline
200 | public export %inline
205 | public export %inline
210 | public export %inline
215 | public export %inline
220 | public export %inline
225 | public export %inline
230 | public export %inline
235 | public export %inline
240 | public export %inline
245 | public export %inline
250 | public export %inline
255 | public export %inline
260 | public export %inline
265 | public export %inline
270 | public export %inline
275 | public export %inline
280 | public export %inline
285 | public export %inline
290 | public export %inline
295 | public export %inline
300 | public export %inline
305 | public export %inline
310 | public export %inline
315 | inRange : (lo,hi,scr : Bits8) -> (0 _ : (lo <= hi) === True) => Bool
316 | inRange lo hi scr = case prim__gte_Bits8 scr lo of
318 | _ => case prim__lte_Bits8 scr hi of
322 | public export %inline
323 | isDigit : Bits8 -> Bool
324 | isDigit x = inRange byte_0 byte_9 x
326 | public export %inline
327 | isLower : Bits8 -> Bool
328 | isLower x = inRange byte_a byte_z x
330 | public export %inline
331 | isUpper : Bits8 -> Bool
332 | isUpper x = inRange byte_A byte_Z x
335 | isAlpha : Bits8 -> Bool
336 | isAlpha x = isLower x || isUpper x
339 | isAlphaNum : Bits8 -> Bool
340 | isAlphaNum x = isDigit x || isAlpha x
344 | isSpace : Bits8 -> Bool
355 | isNL : Bits8 -> Bool
363 | toUpper : Bits8 -> Bits8
364 | toUpper x = if (isLower x) then x - 32 else x
369 | toLower : Bits8 -> Bits8
370 | toLower x = if (isUpper x) then x + 32 else x
375 | isHexDigit : Bits8 -> Bool
376 | isHexDigit x = isDigit x || inRange byte_a byte_f (toLower x)
380 | isOctDigit : Bits8 -> Bool
381 | isOctDigit x = inRange byte_0 byte_7 x
385 | isControl : Bits8 -> Bool
386 | isControl x = inRange 0 0x1f x
390 | isDot : Bits8 -> Bool
396 | isComma : Bits8 -> Bool
403 | fromBitDigit : Bits8 -> Maybe Nat
404 | fromBitDigit 48 = Just 0
405 | fromBitDigit 49 = Just 1
406 | fromBitDigit _ = Nothing
411 | fromOctDigit : Bits8 -> Maybe Nat
412 | fromOctDigit 48 = Just 0
413 | fromOctDigit 49 = Just 1
414 | fromOctDigit 50 = Just 2
415 | fromOctDigit 51 = Just 3
416 | fromOctDigit 52 = Just 4
417 | fromOctDigit 53 = Just 5
418 | fromOctDigit 54 = Just 6
419 | fromOctDigit 55 = Just 7
420 | fromOctDigit _ = Nothing
429 | fromDigit : Bits8 -> Maybe Nat
430 | fromDigit 48 = Just 0
431 | fromDigit 49 = Just 1
432 | fromDigit 50 = Just 2
433 | fromDigit 51 = Just 3
434 | fromDigit 52 = Just 4
435 | fromDigit 53 = Just 5
436 | fromDigit 54 = Just 6
437 | fromDigit 55 = Just 7
438 | fromDigit 56 = Just 8
439 | fromDigit 57 = Just 9
440 | fromDigit _ = Nothing
445 | fromHexDigit : Bits8 -> Maybe Nat
446 | fromHexDigit 48 = Just 0
447 | fromHexDigit 49 = Just 1
448 | fromHexDigit 50 = Just 2
449 | fromHexDigit 51 = Just 3
450 | fromHexDigit 52 = Just 4
451 | fromHexDigit 53 = Just 5
452 | fromHexDigit 54 = Just 6
453 | fromHexDigit 55 = Just 7
454 | fromHexDigit 56 = Just 8
455 | fromHexDigit 57 = Just 9
456 | fromHexDigit 97 = Just 10
457 | fromHexDigit 98 = Just 11
458 | fromHexDigit 99 = Just 12
459 | fromHexDigit 100 = Just 13
460 | fromHexDigit 101 = Just 14
461 | fromHexDigit 102 = Just 15
462 | fromHexDigit 65 = Just 10
463 | fromHexDigit 66 = Just 11
464 | fromHexDigit 67 = Just 12
465 | fromHexDigit 68 = Just 13
466 | fromHexDigit 69 = Just 14
467 | fromHexDigit 70 = Just 15
468 | fromHexDigit _ = Nothing