From cf4563564d6df75acb27d52bbe41d11a3a15215e Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 19 Oct 2020 16:03:07 -0400 Subject: [PATCH] =?UTF-8?q?fix=20up=20addition=20of=20`=C2=A6`=20and=20`?= =?UTF-8?q?=E2=8C=BF`=20operators=20(#37973)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NEWS.md | 2 ++ src/flisp/julia_extensions.c | 4 +++- test/syntax.jl | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 617978fe41416..a8401633fe11a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -41,6 +41,8 @@ Language changes instead of `:call`. * Instances of `UniformScaling` are no longer `isequal` to matrices. Previous behaviour violated the rule that `isequal(x, y)` implies `hash(x) == hash(y)`. +* `⌿` (U+233F) and `¦` (U+00A6) are now infix operators with times-like and plus-like precedence, + respectively. Previously they were parsed as identifier characters ([#37973]). Compiler/Runtime improvements ----------------------------- diff --git a/src/flisp/julia_extensions.c b/src/flisp/julia_extensions.c index bad9c53d3f5d9..e6ffcfcde131c 100644 --- a/src/flisp/julia_extensions.c +++ b/src/flisp/julia_extensions.c @@ -72,7 +72,9 @@ static int is_wc_cat_id_start(uint32_t wc, utf8proc_category_t cat) cat == UTF8PROC_CATEGORY_SC || // allow currency symbols // other symbols, but not arrows or replacement characters (cat == UTF8PROC_CATEGORY_SO && !(wc >= 0x2190 && wc <= 0x21FF) && - wc != 0xfffc && wc != 0xfffd) || + wc != 0xfffc && wc != 0xfffd && + wc != 0x233f && // notslash + wc != 0x00a6) || // broken bar // math symbol (category Sm) whitelist (wc >= 0x2140 && wc <= 0x2a1c && diff --git a/test/syntax.jl b/test/syntax.jl index ea79905b10809..e77780c009be1 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -2490,3 +2490,6 @@ end in 1:3 end""") end + +# PR #37973 +@test Meta.parse("1¦2⌿3") == Expr(:call, :¦, 1, Expr(:call, :⌿, 2, 3))