Warning, /utilities/kate/addons/symbolviewer/samples/testfile.jl is written in an unsupported language. File is not indexed.
0001 0002 """Some multi-line comment documenting FooParams 0003 • foo 0004 • bar 0005 • baz 0006 """ 0007 abstract type FooParams end 0008 0009 """Do NOT try this at home!""" 0010 @with_kw struct Parameters <: FooParams 0011 0012 end 0013 0014 0015 0016 """Do NOT try this at home!""" 0017 @with_kw mutable struct MutableParameters <: FooParams 0018 0019 end 0020 0021 mutable struct Concentration{T} where T 0022 x::T 0023 end 0024 0025 struct TestMe2 0026 end 0027 0028 0029 0030 @inline Foo_αₕ(v::Union{Int64, Float64}) = 0.07 * exp(-(v + 65)/20) 0031 Fooβₕ(v::Union{Int64, Float64}) = 0.07 * exp(-(v + 65)/20) 0032 0033 Base.display(x::FooParams) = disp(x) 0034 0035 0036 """Adds a method to a function defined in the Base module""" 0037 @inline function Base.MethodOfBaseFoo (v::Union{Int64, Float64}; useMagic::Bool=false) 0038 end 0039 0040 """Adds a method to a Base function. 0041 Returns pairs of key/values from a FooParams type 0042 # Signatures 0043 0044 $(TYPEDSIGNATURES) 0045 """ 0046 Base.pairs(x::FooParams; strip::Bool=false) = ifelse(strip, 0047 map((f) -> f => stripUnits(getproperty(x, f)), fieldnames(typeof(x))), 0048 map((f) -> f => getproperty(x, f), fieldnames(typeof(x))), 0049 ) 0050 0051 0052 baz(v, V½, 𝒌) = 1/(1+exp((V½-v)/𝒌)) 0053 0054 function useless_ 0055 end 0056 0057 function disp(x::FooParams) 0058 end 0059 0060 """ 0061 $(TYPEDSIGNATURES) 0062 """ 0063 function bar!(x::Symbol,y::AbstractDict{Symbol, Any}, z...; 0064 flag::Bool = true, 0065 flag2=false) 0066 0067 end 0068 0069 0070 """baz 0071 $(TYPEDSIGNATURES) 0072 """ 0073 bar(Xᵢ::Concentration{T}, Xₒ::Concentration{U}, zₓ::Int64, t::Unitful.Temperature{V}) where {T<:Real, U<:Real, V<:Real} = Unitful.R * uconvert(u"K", t) * 0074 log(Xₒ/Xᵢ) / (zₓ * 𝑭) 0075 0076 """Creates an OrderedDict from a parameters struct""" 0077 params2dict(x::FooParams) = OrderedDict(sort(collect(type2dict(x)), by=(y)->y[1])) 0078 0079 function baz2!(rates, xc, xd, p, t) 0080 end 0081 0082 function broken_params_line(param1::FooParams, param2::Union{NTuple{2,Union{Float64, Unitful.Time{Float64}}},Nothing}=nothing; 0083 flag1::Bool=true, 0084 flag2::Bool = true, 0085 kwargs...) 0086 0087 0088 end 0089 0090 0091 @inline function inline_function(a,b,c) 0092 if length(a) 0093 end 0094 end 0095 0096 @noinline function noinline_function(a,b,c) 0097 end 0098 0099 @noinline shortdef(x) = ... 0100 0101 0102 function test_where (a::T) where T<:FooParams 0103 end 0104 0105 @inline function test_where2 (a::T) where T<:FooParams 0106 end 0107 0108 # anonymous function 0109 f() do 0110 @noinline 0111 ... 0112 end 0113 0114 macro sayhello() 0115 return :( println("Hello, world!") ) 0116 end 0117 0118 macro twostep(arg) 0119 println("I execute at parse time. The argument is: ", arg) 0120 return :(println("I execute at runtime. The argument is: ", $arg)) 0121 end 0122 0123 0124 0125 0126 0127 0128 a = b