Juno block end

I encountered a strange issue: Sometimes Juno does not find the end-statement of a block and therefore execution is not possible. When I move the end statement to the last regular line, it works.

I recall having had this problem around a year ago, but I don’t remember how I got rid of it. The code is the following:

function main()
    foo=1
    for i = 1:1
        if(true)
            foo = 1
        end
    end
    return foo
end

function main()
    foo=1
    for i = 1:1
        if(true)
            foo = 1
        end
    end
    return foo end

I work with julia-client 0.11.3, ink 0.11.7 and language-julia 0.19.2 in Atom 1.41.0 on Windows.

Based on the highlighting, it looks like if is being used as a function. Try if true without the parentheses.

2 Likes

That’s caused by
https://github.com/JuliaEditorSupport/atom-language-julia/issues/172

So yeah, add some whitespace (if (true)) or remove the parens altogether.

2 Likes