about summary refs log tree commit diff stats
path: root/src/utils/twtstr.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-26 19:42:19 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-26 19:42:19 +0100
commit774aad55da0fc62f8de8c95dbbb3d2ad41010e3f (patch)
treec80f7a6d783261b5fe741749aa5f8a52abcc7919 /src/utils/twtstr.nim
parent636ddbb788a4a4dcd4dc4bc247159b6bb191ef8a (diff)
downloadchawan-774aad55da0fc62f8de8c95dbbb3d2ad41010e3f.tar.gz
dom: correct constructors, more create functions
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r--src/utils/twtstr.nim9
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