Invalid semantic tokens with checker.mligo
If you clone https://github.com/marigold-dev/checker-ligo and open checker.mligo
(n.b.: this is pretty slow, see #2143), and open the logs for LIGO Semantic Tokens, you'll see a bunch of warnings:
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 21:1 (length 79) with token type 17 (modifier 0) at group 61.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 30:1 (length 256) with token type 17 (modifier 0) at group 112.
[Warn - 10:25:28 AM] Got negative delta (-5, 2) or length at 139:3 (length 256) with token type 17 (modifier 0) at group 1046.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 263:1 (length 256) with token type 17 (modifier 0) at group 1984.
[Warn - 10:25:28 AM] Got negative delta (-12, 2) or length at 280:3 (length 256) with token type 17 (modifier 0) at group 2087.
[Warn - 10:25:28 AM] Got negative delta (-12, 2) or length at 320:3 (length 256) with token type 17 (modifier 0) at group 2287.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 358:1 (length 256) with token type 17 (modifier 0) at group 2448.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 373:1 (length 256) with token type 17 (modifier 0) at group 2572.
[Warn - 10:25:28 AM] Got negative delta (-1, 2) or length at 378:3 (length 256) with token type 17 (modifier 0) at group 2604.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 407:1 (length 79) with token type 17 (modifier 0) at group 2720.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 549:1 (length 79) with token type 17 (modifier 0) at group 3557.
[Warn - 10:25:28 AM] Got negative delta (-4, 2) or length at 564:3 (length 256) with token type 17 (modifier 0) at group 3657.
[Warn - 10:25:28 AM] Got negative delta (-7, 0) or length at 623:1 (length 79) with token type 17 (modifier 0) at group 3943.
[Warn - 10:25:28 AM] Got negative delta (-3, 0) or length at 650:1 (length 256) with token type 17 (modifier 0) at group 4066.
[Warn - 10:25:28 AM] Got negative delta (-5, 0) or length at 677:1 (length 256) with token type 17 (modifier 0) at group 4220.
[Warn - 10:25:28 AM] Got negative delta (-3, 4) or length at 700:5 (length 63) with token type 17 (modifier 0) at group 4313.
[Warn - 10:25:28 AM] Got negative delta (-1, 4) or length at 709:5 (length 256) with token type 17 (modifier 0) at group 4350.
[Warn - 10:25:28 AM] Got negative delta (-1, 4) or length at 715:5 (length 256) with token type 17 (modifier 0) at group 4389.
[Warn - 10:25:28 AM] Got negative delta (-4, 4) or length at 723:5 (length 256) with token type 17 (modifier 0) at group 4449.
[Warn - 10:25:28 AM] Got negative delta (-4, 4) or length at 731:5 (length 40) with token type 17 (modifier 0) at group 4472.
[Warn - 10:25:28 AM] Got negative delta (-7, 0) or length at 751:1 (length 79) with token type 17 (modifier 0) at group 4554.
[Warn - 10:25:28 AM] Got negative delta (-5, 4) or length at 764:5 (length 256) with token type 17 (modifier 0) at group 4619.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 784:1 (length 79) with token type 17 (modifier 0) at group 4767.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 808:1 (length 79) with token type 17 (modifier 0) at group 4959.
[Warn - 10:25:28 AM] Got negative delta (-2, 0) or length at 883:1 (length 79) with token type 17 (modifier 0) at group 5508.
This likely indicates that something in the CST (or our CST fold, or our processing of it in our semantic tokens implementation) is going in the wrong order (in terms of regions).
Acceptance criteria
- Semantic tokens are fixed so all of these warnings are eliminated.
- Tests added.