From 8ecad5fe6a6228c28e945c002fc3e0676a12c7b6 Mon Sep 17 00:00:00 2001 From: Laine Taffin Altman Date: Tue, 7 Jan 2025 23:28:52 -0800 Subject: [PATCH 1/2] Add Unicode 16 arrow operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit U+1F8B2 🢲 (RIGHTWARDS ARROW WITH LOWER HOOK) --- src/kinds.jl | 1 + test/tokenize.jl | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/kinds.jl b/src/kinds.jl index dafc91de..dec74772 100644 --- a/src/kinds.jl +++ b/src/kinds.jl @@ -479,6 +479,7 @@ register_kinds!(JuliaSyntax, 0, [ "↶" "↺" "↻" + "🢲" "END_ARROW" # Level 4 diff --git a/test/tokenize.jl b/test/tokenize.jl index e2d069da..a608e249 100644 --- a/test/tokenize.jl +++ b/test/tokenize.jl @@ -920,6 +920,9 @@ end if VERSION >= v"1.10-DEV" push!(ops, "⥷ ⥺ ⟇") end + if VERSION >= v"1.12-DEV" + push!(ops, "🢲") + end allops = split(join(ops, " "), " ") @test all(s->Base.isoperator(Symbol(s)) == is_operator(first(collect(tokenize(s))).kind), allops) end From 4dc5d9736416aa561f7c06be9bc2afca7a351bf6 Mon Sep 17 00:00:00 2001 From: Claire Foster Date: Thu, 23 Jan 2025 11:45:34 +1000 Subject: [PATCH 2/2] =?UTF-8?q?Add=20tokenizer=20special=20case=20for=20'?= =?UTF-8?q?=F0=9F=A2=B2'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tokenize.jl | 1 + test/tokenize.jl | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tokenize.jl b/src/tokenize.jl index af78bee4..ef7b3f98 100644 --- a/src/tokenize.jl +++ b/src/tokenize.jl @@ -22,6 +22,7 @@ end function is_identifier_start_char(c::Char) c == EOF_CHAR && return false isvalid(c) || return false + c == '🢲' && return false # First divergence from Base.is_id_start_char return Base.is_id_start_char(c) end diff --git a/test/tokenize.jl b/test/tokenize.jl index a608e249..6fe7f1ad 100644 --- a/test/tokenize.jl +++ b/test/tokenize.jl @@ -920,11 +920,11 @@ end if VERSION >= v"1.10-DEV" push!(ops, "⥷ ⥺ ⟇") end - if VERSION >= v"1.12-DEV" - push!(ops, "🢲") - end allops = split(join(ops, " "), " ") @test all(s->Base.isoperator(Symbol(s)) == is_operator(first(collect(tokenize(s))).kind), allops) + + # "\U1f8b2" added in Julia 1.12 + @test is_operator(first(collect(tokenize("🢲")))) end const all_kws = Set([