Skip to content

Commit 229a698

Browse files
Add JuliaLang/JuliaSyntax.jl#525 to NEWS.md, flisp parser, and REPL (#57143)
Now that JuliaLang/JuliaSyntax.jl#525 has been merged, also add it to the flisp parser and REPL, and document it!
1 parent 58daba4 commit 229a698

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ New language features
55
---------------------
66

77
- New `Base.@acquire` macro for a non-closure version of `Base.acquire(f, s::Base.Semaphore)`, like `@lock`. ([#56845])
8+
- The character U+1F8B2 🢲 (RIGHTWARDS ARROW WITH LOWER HOOK), newly added by Unicode 16,
9+
is now a valid operator with arrow precedence, accessible as `\hookunderrightarrow` at the REPL.
10+
([JuliaLang/JuliaSyntax.jl#525], [#57143])
811

912
Language changes
1013
----------------

src/flisp/julia_extensions.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ JL_DLLEXPORT int jl_id_start_char(uint32_t wc)
130130
return 1;
131131
if (wc < 0xA1 || wc > 0x10ffff)
132132
return 0;
133+
// "Rightwards Arrow with Lower Hook"
134+
if (wc == 0x1f8b2)
135+
return 1;
133136
return is_wc_cat_id_start(wc, utf8proc_category((utf8proc_int32_t) wc));
134137
}
135138

@@ -147,7 +150,9 @@ JL_DLLEXPORT int jl_id_char(uint32_t wc)
147150
cat == UTF8PROC_CATEGORY_SK || cat == UTF8PROC_CATEGORY_ME ||
148151
cat == UTF8PROC_CATEGORY_NO ||
149152
// primes (single, double, triple, their reverses, and quadruple)
150-
(wc >= 0x2032 && wc <= 0x2037) || (wc == 0x2057))
153+
(wc >= 0x2032 && wc <= 0x2037) || (wc == 0x2057) ||
154+
// "Rightwards Arrow with Lower Hook"
155+
wc == 0x1f8b2)
151156
return 1;
152157
return 0;
153158
}

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ const latex_symbols = Dict(
517517
"\\mapsto" => "",
518518
"\\hookleftarrow" => "",
519519
"\\hookrightarrow" => "",
520+
"\\hookunderrightarrow" => "🢲",
520521
"\\looparrowleft" => "",
521522
"\\looparrowright" => "",
522523
"\\leftrightsquigarrow" => "",

test/syntax.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,11 @@ end
22872287
@test Meta.parse("a ⥷ b") == Expr(:call, :, :a, :b)
22882288
end
22892289

2290+
# issue 57143
2291+
@testset "binary 🢲" begin
2292+
@test Meta.parse("a 🢲 b") == Expr(:call, :🢲, :a, :b)
2293+
end
2294+
22902295
# only allow certain characters after interpolated vars (#25231)
22912296
@test_parseerror("\"\$x෴ \"",
22922297
"interpolated variable \$x ends with invalid character \"\"; use \"\$(x)\" instead.")

0 commit comments

Comments
 (0)