# Juno block end

**URL:** <https://discourse.julialang.org/t/juno-block-end/32214>\
**Category:** Juno\
**Created:** [December 12, 2019, 11:15pm UTC](https://discourse.julialang.org/t/juno-block-end/32214 "2019-12-12T23:15:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![economyboy](https://avatars.discourse-cdn.com/v4/letter/e/eb8c5e/32.png) [@economyboy](https://discourse.julialang.org/u/economyboy)\
**Post date:** [December 12, 2019, 11:15pm UTC](https://discourse.julialang.org/t/juno-block-end/32214/1 "2019-12-12T23:15:09Z")

</div>

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.

 ![JunoError](https://global.discourse-cdn.com/julialang/original/3X/8/f/8faafde9b51ff135d8eb96c0b9c852f40c5d626c.png)

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:

```julia
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.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [December 13, 2019, 8:38am UTC](https://discourse.julialang.org/t/juno-block-end/32214/2 "2019-12-13T08:38:21Z")

</div>

> [@economyboy](#):
>
> function main() foo=1 for i = 1:1 if(true) foo = 1 end end return foo end

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

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [December 13, 2019, 8:44am UTC](https://discourse.julialang.org/t/juno-block-end/32214/3 "2019-12-13T08:44:46Z")

</div>

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

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