From 774aad55da0fc62f8de8c95dbbb3d2ad41010e3f Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 26 Dec 2022 19:42:19 +0100 Subject: dom: correct constructors, more create functions --- src/utils/twtstr.nim | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/utils/twtstr.nim') 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 -- cgit 1.4.1-2-gfad0