@@ -3,7 +3,7 @@
Loading
3 3
include("exception_types.jl")
4 4
5 5
using SymbolServer, CSTParser
6 -
using CSTParser: EXPR, isidentifier, Import, Using, Export, Quote, Quotenode, x_Str, FunctionDef, setparent!, kindof, valof, typof, parentof, is_assignment, isoperator, ispunctuation, iskw, defines_function
6 +
using CSTParser: EXPR, isidentifier, Import, Using, Export, Quote, Quotenode, x_Str, FunctionDef, setparent!, kindof, valof, typof, parentof, is_assignment, isoperator, ispunctuation, iskw, defines_function, is_splat
7 7
using SymbolServer: VarRef
8 8
9 9
const noname = EXPR(CSTParser.NoHead, nothing, 0, 0, nothing, CSTParser.NoKind, false, nothing, nothing)
@@ -136,7 +136,7 @@
Loading
136 136
    followinclude(x, state)
137 137
138 138
Checks whether the arguments of a call to `include` can be resolved to a path.
139 -
If successful it checks whether a file with that path is loaded on the server  
139 +
If successful it checks whether a file with that path is loaded on the server
140 140
or a file exists on the disc that can be loaded.
141 141
If this is successful it traverses the code associated with the loaded file.
142 142

@@ -143,21 +143,20 @@
Loading
143 143
        if ispunctuation(arg)
144 144
            # skip
145 145
        elseif is_parameters(arg)
146 -
            for j = 1:length(arg)
147 -
                arg1 = arg[j]
148 -
                if is_kwarg(arg1)
149 -
                    push!(kws, Symbol(CSTParser.str_value(CSTParser.get_arg_name(arg1[1]))))
150 -
                elseif is_unary_call(arg1) && kindof(arg1[2]) === CSTParser.Tokens.DDDOT
146 +
            for a in arg
147 +
                if is_kwarg(a)
148 +
                    push!(kws, Symbol(CSTParser.str_value(CSTParser.get_arg_name(a[1]))))
149 +
                elseif is_splat(a)
151 150
                    kwsplat = true
152 151
                end
153 152
            end
154 153
        elseif is_kwarg(arg)
155 -
            if is_unary_call(arg[1]) && kindof(arg[1][2]) === CSTParser.Tokens.DDDOT
154 +
            if is_splat(arg[1])
156 155
                maxargs = typemax(Int)
157 156
            else
158 157
                maxargs !== typemax(Int) && (maxargs += 1)
159 158
            end
160 -
        elseif (is_unary_call(arg) && kindof(arg[2]) === CSTParser.Tokens.DDDOT) ||
159 +
        elseif is_splat(arg) ||
161 160
            (is_declaration(arg) &&
162 161
            ((isidentifier(arg[3]) && valofid(arg[3]) == "Vararg") ||
163 162
            (is_curly(arg[3]) && isidentifier(arg[3][1]) && valofid(arg[3][1]) == "Vararg")))
@@ -224,17 +223,24 @@
Loading
224 223
225 224
# compare_f_call(m_counts, call_counts) = true # fallback method
226 225
227 -
function compare_f_call(m_counts::Tuple{Int,Int,Array{Symbol},Bool}, call_counts::Tuple{Int,Int,Array{Symbol}})
228 -
    if call_counts[2] == typemax(Int)
229 -
        call_counts[1] <= call_counts[2] < m_counts[1] && return false
226 +
function compare_f_call(
227 +
    (ref_minargs, ref_maxargs, ref_kws, kwsplat),
228 +
    (act_minargs, act_maxargs, act_kws),
229 +
)
230 +
    # check matching on positional arguments
231 +
    if act_maxargs == typemax(Int)
232 +
        act_minargs <= act_maxargs < ref_minargs && return false
230 233
    else
231 -
        !(m_counts[1] <= call_counts[1] <= call_counts[2] <= m_counts[2]) && return false
232 -
    end
233 -
    if !m_counts[4] # no splatted kw in method sig
234 -
        length(call_counts[3]) > length(m_counts[3]) && return false # call has more kws than method accepts
235 -
        !all(kw in m_counts[3] for kw in call_counts[3]) && return false # call supplies a kw that isn't defined in the method
236 -
    else # splatted kw in method so accept any kw in call
234 +
        !(ref_minargs <= act_minargs <= act_maxargs <= ref_maxargs) && return false
237 235
    end
236 +
237 +
    # check matching on keyword arguments
238 +
    kwsplat && return true # splatted kw in method so accept any kw in call
239 +
240 +
    # no splatted kw in method sig
241 +
    length(act_kws) > length(ref_kws) && return false # call has more kws than method accepts
242 +
    !all(kw in ref_kws for kw in act_kws) && return false # call supplies a kw that isn't defined in the method
243 +
238 244
    return true
239 245
end
240 246
Files Coverage
src 73.22%
Project Totals (11 files) 73.22%
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests
codecov-umbrella
Build #226932375 -
unittests

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading