From 3d5e3227e6fbc4b8cc3ead7c2e1c533c6711783b Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 30 Jan 2022 20:46:06 +0100 Subject: [PATCH] allow .. as an identifier, fixes #1875 --- src/analysis/ExpressionExplorer.jl | 2 +- test/React.jl | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/analysis/ExpressionExplorer.jl b/src/analysis/ExpressionExplorer.jl index eddb6186c0..cb54f70a0a 100644 --- a/src/analysis/ExpressionExplorer.jl +++ b/src/analysis/ExpressionExplorer.jl @@ -271,7 +271,7 @@ end # this is stupid -- désolé function is_joined_funcname(joined::Symbol) - occursin('.', String(joined)) + joined !== :.. #= .. is a valid identifier 😐 =# && occursin('.', String(joined)) end assign_to_kw(e::Expr) = e.head == :(=) ? Expr(:kw, e.args...) : e diff --git a/test/React.jl b/test/React.jl index f7a1dcb6a6..42cf04cd1b 100644 --- a/test/React.jl +++ b/test/React.jl @@ -159,6 +159,16 @@ import Distributed end end + @testset ".. as an identifier" begin + notebook = Notebook(Cell.([ + ".. = 1", + "..", + ])) + update_run!(🍭, notebook, notebook.cells) + + @test all(noerror, notebook.cells) + @test notebook.cells[end].output.body == "1" + end # PlutoTest.jl is only working on Julia version >= 1.6 VERSION >= v"1.6" && @testset "Test Firebasey" begin