Skip to content

Commit ad939df

Browse files
authored
Add U+297A () and U+2977 () to binary operators (recreated) (#49623)
1 parent c0e12cd commit ad939df

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Julia v1.10 Release Notes
44
New language features
55
---------------------
66

7+
* `` (U+297A, `\leftarrowsubset`) and `` (U+2977, `\leftarrowless`)
8+
may now be used as binary operators with arrow precedence. ([#45962])
9+
710
Language changes
811
----------------
912

src/julia-parser.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
;; comma - higher than assignment outside parentheses, lower when inside
1111
(define prec-pair (add-dots '(=>)))
1212
(define prec-conditional '(?))
13-
(define prec-arrow (add-dots '(← → ↔ ↚ ↛ ↞ ↠ ↢ ↣ ↦ ↤ ↮ ⇎ ⇍ ⇏ ⇐ ⇒ ⇔ ⇴ ⇶ ⇷ ⇸ ⇹ ⇺ ⇻ ⇼ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿ ⤀ ⤁ ⤂ ⤃ ⤄ ⤅ ⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤐ ⤑ ⤔ ⤕ ⤖ ⤗ ⤘ ⤝ ⤞ ⤟ ⤠ ⥄ ⥅ ⥆ ⥇ ⥈ ⥊ ⥋ ⥎ ⥐ ⥒ ⥓ ⥖ ⥗ ⥚ ⥛ ⥞ ⥟ ⥢ ⥤ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥰ ⧴ ⬱ ⬰ ⬲ ⬳ ⬴ ⬵ ⬶ ⬷ ⬸ ⬹ ⬺ ⬻ ⬼ ⬽ ⬾ ⬿ ⭀ ⭁ ⭂ ⭃ ⭇ ⭈ ⭉ ⭊ ⭋ ⭌ ← → ⇜ ⇝ ↜ ↝ ↩ ↪ ↫ ↬ ↼ ↽ ⇀ ⇁ ⇄ ⇆ ⇇ ⇉ ⇋ ⇌ ⇚ ⇛ ⇠ ⇢ ↷ ↶ ↺ ↻ --> <-- <-->)))
13+
(define prec-arrow (add-dots '(← → ↔ ↚ ↛ ↞ ↠ ↢ ↣ ↦ ↤ ↮ ⇎ ⇍ ⇏ ⇐ ⇒ ⇔ ⇴ ⇶ ⇷ ⇸ ⇹ ⇺ ⇻ ⇼ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿ ⤀ ⤁ ⤂ ⤃ ⤄ ⤅ ⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤐ ⤑ ⤔ ⤕ ⤖ ⤗ ⤘ ⤝ ⤞ ⤟ ⤠ ⥄ ⥅ ⥆ ⥇ ⥈ ⥊ ⥋ ⥎ ⥐ ⥒ ⥓ ⥖ ⥗ ⥚ ⥛ ⥞ ⥟ ⥢ ⥤ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥰ ⧴ ⬱ ⬰ ⬲ ⬳ ⬴ ⬵ ⬶ ⬷ ⬸ ⬹ ⬺ ⬻ ⬼ ⬽ ⬾ ⬿ ⭀ ⭁ ⭂ ⭃ ⥷ ⭄ ⥺ ⭇ ⭈ ⭉ ⭊ ⭋ ⭌ ← → ⇜ ⇝ ↜ ↝ ↩ ↪ ↫ ↬ ↼ ↽ ⇀ ⇁ ⇄ ⇆ ⇇ ⇉ ⇋ ⇌ ⇚ ⇛ ⇠ ⇢ ↷ ↶ ↺ ↻ --> <-- <-->)))
1414
(define prec-lazy-or (add-dots '(|\|\||)))
1515
(define prec-lazy-and (add-dots '(&&)))
1616
(define prec-comparison

stdlib/REPL/src/latex_symbols.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,9 @@ const latex_symbols = Dict(
15701570
"\\bsimilarleftarrow" => "\u2b41", # reverse tilde operator above leftwards arrow
15711571
"\\leftarrowbackapprox" => "\u2b42", # leftwards arrow above reverse almost equal to
15721572
"\\rightarrowgtr" => "\u2b43", # rightwards arrow through greater-than
1573-
"\\rightarrowsupset" => "\u2b44", # rightwards arrow through subset
1573+
"\\leftarrowless" => "\u2977", # leftwards arrow through less-than
1574+
"\\rightarrowsupset" => "\u2b44", # rightwards arrow through superset
1575+
"\\leftarrowsubset" => "\u297a", # leftwards arrow through subset
15741576
"\\LLeftarrow" => "\u2b45", # leftwards quadruple arrow
15751577
"\\RRightarrow" => "\u2b46", # rightwards quadruple arrow
15761578
"\\bsimilarrightarrow" => "\u2b47", # reverse tilde operator above rightwards arrow

test/syntax.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,14 @@ end
22282228
@test Meta.parse("a ⫫ b") == Expr(:call, :, :a, :b)
22292229
end
22302230

2231+
# issue 45962
2232+
@testset "binary ⭄, ⥺, ⭃, and ⥷" begin
2233+
@test Meta.parse("a ⭄ b") == Expr(:call, :, :a, :b)
2234+
@test Meta.parse("a ⥺ b") == Expr(:call, :, :a, :b)
2235+
@test Meta.parse("a ⭃ b") == Expr(:call, :, :a, :b)
2236+
@test Meta.parse("a ⥷ b") == Expr(:call, :, :a, :b)
2237+
end
2238+
22312239
# only allow certain characters after interpolated vars (#25231)
22322240
@test Meta.parse("\"\$x෴ \"",raise=false) == Expr(:error, "interpolated variable \$x ends with invalid character \"\"; use \"\$(x)\" instead.")
22332241
@test Base.incomplete_tag(Meta.parse("\"\$foo", raise=false)) === :string

0 commit comments

Comments
 (0)