Skip to content

Commit

Permalink
fix up addition of ¦ and operators (#37973)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Oct 19, 2020
1 parent 777f23d commit cf45635
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------------
Expand Down
4 changes: 3 additions & 1 deletion src/flisp/julia_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
3 changes: 3 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit cf45635

Please sign in to comment.