about summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-27 18:45:17 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-27 18:45:17 +0100
commit0f2c08006a8787fc1a8a67ecf125fdffadd245ff (patch)
tree77db5c898bf8f55835466efa175342fa42a32f01 /res
parent5c978a3441cec24f2ffbd11b6e6bb3e2f429aadf (diff)
downloadchawan-0f2c08006a8787fc1a8a67ecf125fdffadd245ff.tar.gz
misc refactorings
* rename buffer enums
* fix isAscii for char 0x80
* remove dead code from URL
Diffstat (limited to 'res')
-rw-r--r--res/genidna.nim19
-rw-r--r--res/map/idna_gen.nim4
2 files changed, 0 insertions, 23 deletions
diff --git a/res/genidna.nim b/res/genidna.nim
index bd8e8bf7..8aed63b2 100644
--- a/res/genidna.nim
+++ b/res/genidna.nim
@@ -14,7 +14,6 @@ var MappedMapHigh: HighMap
 var DisallowedRanges: FullRangeList
 var Disallowed: FullSet
 var Ignored: FullSet
-var Deviation: LowMap
 
 proc loadIdnaData() =
   template add_map(i: uint32, str: string) =
@@ -43,9 +42,6 @@ proc loadIdnaData() =
       Ignored.lm.add(uint16(i))
     else:
       Ignored.hm.add(i)
-  template add_deviation(i: uint32, str: string) =
-    assert i <= high(uint16)
-    Deviation.add((uint16(i), str))
   template add(firstcol: string, str: string, temp: untyped) =
     if firstcol.contains(".."):
       let fcs = firstcol.split("..")
@@ -119,13 +115,6 @@ proc loadIdnaData() =
         str &= Rune(parseHexInt(code))
 
       add(firstcol, str, add_map)
-    of "deviation":
-      let codepoints = thirdcol
-      var str = ""
-      for code in codepoints:
-        str &= Rune(parseHexInt(code))
-
-      add(firstcol, str, add_deviation)
     of "valid":
       if fourthcol == "NV8" or fourthcol == "XV8":
         add(firstcol, add_disallow)
@@ -208,12 +197,4 @@ proc main() =
   writer.flush()
   echo "]"
 
-  echo ""
-  echo "const Deviation: array[" & $Deviation.len &
-    ", tuple[ucs: uint16, s: Z]] = ["
-  for (ucs, s) in Deviation:
-    writer.write("(" & $ucs & "," & s.escape() & ".Z),")
-  writer.flush()
-  echo "]"
-
 main()
diff --git a/res/map/idna_gen.nim b/res/map/idna_gen.nim
index ca19239a..0f99d130 100644
--- a/res/map/idna_gen.nim
+++ b/res/map/idna_gen.nim
@@ -2413,7 +2413,3 @@ const IgnoredHigh: array[244, uint32] = [
 917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,
 917998,917999,
 ]
-
-const Deviation: array[4, tuple[ucs: uint16, s: Z]] = [
-(223,"ss".Z),(962,"\xCF\x83".Z),(8204,"".Z),(8205,"".Z),
-]