Parsing of :


#1

Is this handling of : by Julia parser intentional?

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. https://stackoverflow.com/questions/49074439/julia-invalid-assignment-location-when-creating-function-to-subset-dataframe).


#2

Cf


probably just needs attention.


#3

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