Skip to content

Commit 22caab0

Browse files
pthariensflamec42f
andauthored
Add U+1F8B2 🢲 as an operator (#525)
The character U+1F8B2 🢲 (RIGHTWARDS ARROW WITH LOWER HOOK) is new is Unicode 16; it is of a kind (no pun intended) with the longstanding characters U+21A9 ↩ (LEFTWARDS ARROW WITH HOOK) and U+21AA ↪ (RIGHTWARDS ARROW WITH HOOK), both of which are already supported as operators in Julia. It was added to Unicode as part of the Symbols for Legacy Computing effort, wherein it was sourced from Smalltalk character sets in the 1970s—so it has a very long history of being used in programming languages. --------- Co-authored-by: Claire Foster <[email protected]>
1 parent 820b646 commit 22caab0

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

‎src/kinds.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ register_kinds!(JuliaSyntax, 0, [
464464
"↶"
465465
"↺"
466466
"↻"
467+
"🢲"
467468
"END_ARROW"
468469

469470
# Level 4

‎src/tokenize.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ end
2222
function is_identifier_start_char(c::Char)
2323
c == EOF_CHAR && return false
2424
isvalid(c) || return false
25+
c == '🢲' && return false # First divergence from Base.is_id_start_char
2526
return Base.is_id_start_char(c)
2627
end
2728

‎test/tokenize.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,9 @@ end
922922
end
923923
allops = split(join(ops, " "), " ")
924924
@test all(s->Base.isoperator(Symbol(s)) == is_operator(first(collect(tokenize(s))).kind), allops)
925+
926+
# "\U1f8b2" added in Julia 1.12
927+
@test is_operator(first(collect(tokenize("🢲"))))
925928
end
926929

927930
const all_kws = Set([

0 commit comments

Comments
 (0)