# Parsing of :

**URL:** <https://discourse.julialang.org/t/parsing-of/9463>\
**Category:** Internals & Design\
**Created:** [March 2, 2018, 7:20pm UTC](https://discourse.julialang.org/t/parsing-of/9463 "2018-03-02T19:20:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [March 2, 2018, 7:20pm UTC](https://discourse.julialang.org/t/parsing-of/9463/1 "2018-03-02T19:20:09Z")

</div>

Is this handling of `:` by Julia parser intentional?

```julia
julia> x[:
       a]
ERROR: ArgumentError: invalid index: a
Stacktrace:
 [1] getindex(::Array{Int64,1}, ::Symbol) at .\abstractarray.jl:883

julia> x[:
       ]
ERROR: syntax: invalid syntax: "]"

julia> function f():
       a
       end
f (generic function with 1 method)

julia> f()
:a:

julia> try :
       a
       end
:a 

```

The reason why it might be important is that the last two examples (defining function and try block) can mislead people switching from Python, who probably have muscle memory to add `:` at the end of such expressions (see e.g. [Julia: invalid assignment location when creating function to subset dataframe - Stack Overflow](https://stackoverflow.com/questions/49074439/julia-invalid-assignment-location-when-creating-function-to-subset-dataframe)).

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 3, 2018, 7:02am UTC](https://discourse.julialang.org/t/parsing-of/9463/2 "2018-03-03T07:02:48Z")

</div>

Cf  
[https://github.com/JuliaLang/julia/pull/20265](https://github.com/JuliaLang/julia/pull/20265)  
probably just needs attention.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [March 3, 2018, 7:07am UTC](https://discourse.julialang.org/t/parsing-of/9463/3 "2018-03-03T07:07:53Z")

</div>

Thanks. I have just checked on master that the issue is fixed.
