diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-26 19:42:19 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-26 19:42:19 +0100 |
commit | 774aad55da0fc62f8de8c95dbbb3d2ad41010e3f (patch) | |
tree | c80f7a6d783261b5fe741749aa5f8a52abcc7919 /src/utils/twtstr.nim | |
parent | 636ddbb788a4a4dcd4dc4bc247159b6bb191ef8a (diff) | |
download | chawan-774aad55da0fc62f8de8c95dbbb3d2ad41010e3f.tar.gz |
dom: correct constructors, more create functions
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r-- | src/utils/twtstr.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index 988f3ad5..06340c59 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -719,6 +719,15 @@ func matchNameProduction*(str: string): bool = return false return true +func matchQNameProduction*(s: string): bool = + var colon = false + for c in s: + if c == ':': + if colon: + return false + colon = true + return s.matchNameProduction() + func utf16Len*(s: string): int = for r in s.runes: if cast[uint32](r) < 0x10000: # ucs-2 |