diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-01 19:05:45 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-01 19:37:48 +0200 |
commit | af3dbce840d0d0956663ffb20012329a4c22d5dd (patch) | |
tree | da3c2bad567d9b08f585cbc973aac61ef4eb05ae /src/utils/twtstr.nim | |
parent | cab49aa0952c24941bcfb9a5b483f796158bf373 (diff) | |
download | chawan-af3dbce840d0d0956663ffb20012329a4c22d5dd.tar.gz |
Fixes & workarounds to compile on Nim 2.0.0
* Import punycode, as it has been removed from stdlib. * Fix some syntax errors * Apparently you can no longer compare distinct pointers with nil. Add explicit comparisons with typeof(nil) instead. * htmlparser: rename _ to other, as semantics of _ have changed. (Quite a shame, it looked better with _. Oh well.) * Explicitly specify mm:refc, as the browser OOMs with orc for some reason. Confirmed to compile & run on 2.0.0, 1.6.14, 1.6.12, 1.6.10 and 1.6.8. (<1.6.8 it's broken & wontfix.)
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r-- | src/utils/twtstr.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index 9273b703..1c2c2a1d 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -5,7 +5,6 @@ import os import math import sequtils import options -import punycode import bindings/libunicode import data/charwidth @@ -13,6 +12,7 @@ import data/idna import js/javascript import utils/map import utils/opt +import lib/punycode when defined(posix): import posix @@ -951,7 +951,9 @@ func isCombining(r: Rune): bool = # We do not store a lookup table of ambiguous ranges, either. type PropertyTable = array[0..(0xFFFF div 8), uint8] -func makePropertyTable(ranges, skip: openarray[(uint32, uint32)] = @[]): PropertyTable = +type RangeMap = openarray[(uint32, uint32)] + +func makePropertyTable(ranges: RangeMap, skip: RangeMap = @[]): PropertyTable = var ucs: uint32 = 0 var j = 0 var k = 0 |