Skip to content

Add JuliaLang/JuliaSyntax.jl#525 to NEWS.md, flisp parser, and REPL #57143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ New language features
---------------------

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

Language changes
----------------
Expand Down
7 changes: 6 additions & 1 deletion src/flisp/julia_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ JL_DLLEXPORT int jl_id_start_char(uint32_t wc)
return 1;
if (wc < 0xA1 || wc > 0x10ffff)
return 0;
// "Rightwards Arrow with Lower Hook"
if (wc == 0x1f8b2)
return 1;
return is_wc_cat_id_start(wc, utf8proc_category((utf8proc_int32_t) wc));
}

Expand All @@ -147,7 +150,9 @@ JL_DLLEXPORT int jl_id_char(uint32_t wc)
cat == UTF8PROC_CATEGORY_SK || cat == UTF8PROC_CATEGORY_ME ||
cat == UTF8PROC_CATEGORY_NO ||
// primes (single, double, triple, their reverses, and quadruple)
(wc >= 0x2032 && wc <= 0x2037) || (wc == 0x2057))
(wc >= 0x2032 && wc <= 0x2037) || (wc == 0x2057) ||
// "Rightwards Arrow with Lower Hook"
wc == 0x1f8b2)
return 1;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
;; comma - higher than assignment outside parentheses, lower when inside
(define prec-pair (add-dots '(=>)))
(define prec-conditional '(?))
(define prec-arrow (add-dots '(← → ↔ ↚ ↛ ↞ ↠ ↢ ↣ ↦ ↤ ↮ ⇎ ⇍ ⇏ ⇐ ⇒ ⇔ ⇴ ⇶ ⇷ ⇸ ⇹ ⇺ ⇻ ⇼ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿ ⤀ ⤁ ⤂ ⤃ ⤄ ⤅ ⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤐ ⤑ ⤔ ⤕ ⤖ ⤗ ⤘ ⤝ ⤞ ⤟ ⤠ ⥄ ⥅ ⥆ ⥇ ⥈ ⥊ ⥋ ⥎ ⥐ ⥒ ⥓ ⥖ ⥗ ⥚ ⥛ ⥞ ⥟ ⥢ ⥤ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥰ ⧴ ⬱ ⬰ ⬲ ⬳ ⬴ ⬵ ⬶ ⬷ ⬸ ⬹ ⬺ ⬻ ⬼ ⬽ ⬾ ⬿ ⭀ ⭁ ⭂ ⭃ ⥷ ⭄ ⥺ ⭇ ⭈ ⭉ ⭊ ⭋ ⭌ ← → ⇜ ⇝ ↜ ↝ ↩ ↪ ↫ ↬ ↼ ↽ ⇀ ⇁ ⇄ ⇆ ⇇ ⇉ ⇋ ⇌ ⇚ ⇛ ⇠ ⇢ ↷ ↶ ↺ ↻ --> <-- <-->)))
(define prec-arrow (add-dots '(← → ↔ ↚ ↛ ↞ ↠ ↢ ↣ ↦ ↤ ↮ ⇎ ⇍ ⇏ ⇐ ⇒ ⇔ ⇴ ⇶ ⇷ ⇸ ⇹ ⇺ ⇻ ⇼ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿ ⤀ ⤁ ⤂ ⤃ ⤄ ⤅ ⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤐ ⤑ ⤔ ⤕ ⤖ ⤗ ⤘ ⤝ ⤞ ⤟ ⤠ ⥄ ⥅ ⥆ ⥇ ⥈ ⥊ ⥋ ⥎ ⥐ ⥒ ⥓ ⥖ ⥗ ⥚ ⥛ ⥞ ⥟ ⥢ ⥤ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥰ ⧴ ⬱ ⬰ ⬲ ⬳ ⬴ ⬵ ⬶ ⬷ ⬸ ⬹ ⬺ ⬻ ⬼ ⬽ ⬾ ⬿ ⭀ ⭁ ⭂ ⭃ ⥷ ⭄ ⥺ ⭇ ⭈ ⭉ ⭊ ⭋ ⭌ ← → ⇜ ⇝ ↜ ↝ ↩ ↪ ↫ ↬ ↼ ↽ ⇀ ⇁ ⇄ ⇆ ⇇ ⇉ ⇋ ⇌ ⇚ ⇛ ⇠ ⇢ ↷ ↶ ↺ ↻ --> <-- <--> 🢲)))
(define prec-lazy-or (add-dots '(|\|\||)))
(define prec-lazy-and (add-dots '(&&)))
(define prec-comparison
Expand Down
1 change: 1 addition & 0 deletions stdlib/REPL/src/latex_symbols.jl
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ const latex_symbols = Dict(
"\\mapsto" => "↦",
"\\hookleftarrow" => "↩",
"\\hookrightarrow" => "↪",
"\\hookunderrightarrow" => "🢲",
"\\looparrowleft" => "↫",
"\\looparrowright" => "↬",
"\\leftrightsquigarrow" => "↭",
Expand Down
5 changes: 5 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2287,6 +2287,11 @@ end
@test Meta.parse("a ⥷ b") == Expr(:call, :⥷, :a, :b)
end

# issue 57143
@testset "binary 🢲" begin
@test Meta.parse("a 🢲 b") == Expr(:call, :🢲, :a, :b)
end

# only allow certain characters after interpolated vars (#25231)
@test_parseerror("\"\$x෴ \"",
"interpolated variable \$x ends with invalid character \"෴\"; use \"\$(x)\" instead.")
Expand Down