about summary refs log tree commit diff stats
path: root/src/utils/charcategory.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-18 20:53:36 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-18 21:12:50 +0200
commitc23ea622d1b34d3d290670e60e231f4f236fec50 (patch)
tree739abbf0490c28f5446469d7244a20a9a0a03502 /src/utils/charcategory.nim
parent38db6ab5be80b255fe40df715adc3b5852875cdd (diff)
downloadchawan-c23ea622d1b34d3d290670e60e231f4f236fec50.tar.gz
url, twtstr: correct number parsing
* do not use std's parse*Int; they accept weird stuff that we do not
  want to accept in any case
* fix bug in parseHost where a parseIpv4 failure would result in an
  empty host
* do not use isDigit, isAlphaAscii
* improve parse*IntImpl error handling
Diffstat (limited to 'src/utils/charcategory.nim')
-rw-r--r--src/utils/charcategory.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/utils/charcategory.nim b/src/utils/charcategory.nim
index 55cbb930..e2c2a045 100644
--- a/src/utils/charcategory.nim
+++ b/src/utils/charcategory.nim
@@ -7,5 +7,6 @@ const AsciiAlpha* = (AsciiUpperAlpha + AsciiLowerAlpha)
 const NonAscii* = {char(0x80)..char(0xFF)}
 const AsciiDigit* = {'0'..'9'}
 const AsciiAlphaNumeric* = AsciiAlpha + AsciiDigit
+const AsciiOctDigit* = {'0'..'7'}
 const AsciiHexDigit* = (AsciiDigit + {'a'..'f', 'A'..'F'})
 const AsciiWhitespace* = {' ', '\n', '\r', '\t', '\f'}