lexer: add seven more unicode operators (#26074)

closes nim-lang/RFCs#571

Adds `⟑ ⟇ ⩓ ⩔ ■ □ ☆` with the same priority as `*`.

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Emmanuel M. Smith🔸
2026-08-05 16:12:17 +02:00
committed by GitHub
parent c69cf36610
commit 27763495bc
4 changed files with 44 additions and 5 deletions

View File

@@ -14,3 +14,26 @@ var y = 45
y *= 9 + 4 * 3
assert x == y
proc `⟑`(x, y: int): int = x * y
proc `⟇`(x, y: int): int = x * y
proc `⩓`(x, y: int): int = x * y
proc `⩔`(x, y: int): int = x * y
proc `■`(x, y: int): int = x * y
proc `□`(x, y: int): int = x * y
proc `☆`(x, y: int): int = x * y
proc `★`(x, y: int): int = x * y
assert 2 + 3 ⟑ 4 ⟇ 5 ⩓ 6 ⩔ 7 ■ 8 □ 9 ☆ 10 ★ 11 == 2 + 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11
proc `⟑=`(x: var int, y: int) = x *= y
proc `⩓++`(x, y: int): int = x * y
var z = 45
z ⟑= a⩓++4⟑3
var w = 45
w *= 9 * 4 * 3
assert z == w