Repository: JuliaLang/julia
File: JuliaLowering/src/compat.jl (Julia)

Code before:
        if s[1] === '.'
            st_k = K".op="
            op = s[2:end-1]
        else
            st_k = K"op="
            op = s[1:end-1]
        end
        child_exprs = Any[e.args[1], Symbol(op), e.args[2]]
    elseif e.head === :comparison
        for i = 2:2:length(child_exprs)
            op,op_esc = unwrap_esc(child_exprs[i])
            @assert op isa Symbol
            op_s = string(op)
            if is_dotted_operator(op_s)
                child_exprs[i] = Expr(:., op_esc(Symbol(op_s[2:end])))
            end
        end
    elseif e.head === :macrocall
        @assert nargs >= 2
        a1,a1_esc = unwrap_esc(e.args[1])
        child_exprs = collect_expr_parameters(e, 3, false)
        if child_exprs[2] isa LineNumberNode
            src = child_exprs[2]
        end
        deleteat!(child_exprs, 2)
        if a1 isa Symbol && a1 === :@__dot__
            child_exprs[1] = Symbol("@.")
        elseif a1 isa Expr && nargs === 2 && a1.args[2] === :@__dot__
            child_exprs[1] = Expr(a1.head, a1.args[1], Symbol("@."))
        elseif a1 isa GlobalRef && a1.mod === Core
            # Syntax-introduced macrocalls are listed here for reference.  We
            # probably don't need to convert these.
            if a1.name === Symbol("@cmd")
            elseif a1.name === Symbol("@doc") && nargs === 4 # two macro args only
                # Single-arg @doc is a lookup not corresponding to K"doc"
                # Revise sometimes calls @doc with three args, but probably shouldn't
                st_k = K"doc"
                child_exprs = child_exprs[2:3]
            elseif a1.name === Symbol("@int128_str")
            elseif a1.name === Symbol("@int128_str")
            elseif a1.name === Symbol("@big_str")
            end
        end
    elseif e.head === Symbol("'")
        @assert nargs === 1
        st_k = K"call"
        child_exprs = Any[e.head, e.args[1]]
    elseif e.head === :. && nargs === 2
        a2, a2_esc = unwrap_esc(e.args[2])
        if a2 isa Expr && a2.head === :tuple
            st_k = K"dotcall"

Review comment (suggestion):
```suggestion
        if a1 isa Symbol && a1 === Symbol("@__dot__")

Code after:
            op,op_esc = unwrap_esc(child_exprs[i])
            @assert op isa Symbol
            op_s = string(op)
            if is_dotted_operator(op_s)
                child_exprs[i] = Expr(:., op_esc(Symbol(op_s[2:end])))
            end
        end
    elseif e.head === :macrocall
        @assert nargs >= 2
        a1,a1_esc = unwrap_esc(e.args[1])
        child_exprs = collect_expr_parameters(e, 3)
        if child_exprs[2] isa LineNumberNode
            src = child_exprs[2]
        end
        deleteat!(child_exprs, 2)
        if a1 isa Symbol && a1 === Symbol("@__dot__")
            child_exprs[1] = Symbol("@.")
        elseif a1 isa Expr && nargs === 2 && a1.args[2] === Symbol("@__dot__")
            child_exprs[1] = Expr(a1.head, a1.args[1], Symbol("@."))
        elseif a1 isa GlobalRef && a1.mod === Core
            # Syntax-introduced macrocalls are listed here for reference.  We
            # probably don't need to convert these.
            if a1.name === Symbol("@cmd")
            elseif a1.name === Symbol("@doc") && nargs === 4 # two macro args only
                # Single-arg @doc is a lookup not corresponding to K"doc"
                # Revise sometimes calls @doc with three args, but probably shouldn't
                st_k = K"doc"
                child_exprs = child_exprs[2:3]
            elseif a1.name === Symbol("@int128_str")
            elseif a1.name === Symbol("@int128_str")
            elseif a1.name === Symbol("@big_str")
            end
        end
    elseif e.head === Symbol("'")
        @assert nargs === 1
        st_k = K"call"
        child_exprs = Any[e.head, e.args[1]]
    elseif e.head === :. && nargs === 2
        a2, a2_esc = unwrap_esc(e.args[2])
        if a2 isa Expr && a2.head === :tuple
            st_k = K"dotcall"
            tuple_exprs = collect_expr_parameters(a2_esc(a2), 1)
            child_exprs = pushfirst!(tuple_exprs, e.args[1])
        elseif a2 isa QuoteNode
            child_exprs[2] = a2_esc(a2.value)
        end
    elseif e.head === :for
        @assert nargs === 2
        child_exprs = Any[_to_iterspec(Any[e.args[1]], false), e.args[2]]
    elseif e.head === :where
        @assert nargs >= 2