Skip to content

Commit c1622b2

Browse files
Merge pull request #103 from ChrisRackauckas/fix-formatting
Apply JuliaFormatter to fix code formatting
2 parents d40a7a7 + 314fa38 commit c1622b2

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,9 @@ From a constructed RuntimeGeneratedFunction, you can retrieve the expressions us
117117
`RuntimeGeneratedFunctions.get_expression` command. For example:
118118

119119
```julia
120+
julia> RuntimeGeneratedFunctions.get_expression(rgf)
120121
ex = :((x) -> x^2)
121122
rgf = @RuntimeGeneratedFunction(ex)
122-
julia> RuntimeGeneratedFunctions.get_expression(rgf)
123-
#=
124-
quote
125-
#= c:\Users\accou\OneDrive\Computer\Desktop\test.jl:39 =#
126-
x ^ 2
127-
end
128-
=#
129123
```
130124

131125
This can be used to get the expression even if `drop_expr` has been performed.

docs/src/index.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,9 @@ From a constructed RuntimeGeneratedFunction, you can retrieve the expressions us
108108
`RuntimeGeneratedFunctions.get_expression` command. For example:
109109

110110
```julia
111+
julia> RuntimeGeneratedFunctions.get_expression(rgf)
111112
ex = :((x) -> x^2)
112113
rgf = @RuntimeGeneratedFunction(ex)
113-
julia> RuntimeGeneratedFunctions.get_expression(rgf)
114-
:((x,)->begin
115-
#= REPL[14]:1 =#
116-
x ^ 2
117-
end)
118114
```
119115

120116
This can be used to get the expression even if `drop_expr` has been performed.
@@ -198,7 +194,6 @@ julia> RuntimeGeneratedFunctions.get_expression(prob.f.f.f_oop)
198194
end)
199195
```
200196

201-
202197
## Reproducibility
203198

204199
```@raw html

src/RuntimeGeneratedFunctions.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ end
4848
```
4949
"""
5050

51-
"$_rgf_docs"
51+
"""
52+
$_rgf_docs
53+
"""
5254
struct RuntimeGeneratedFunction{argnames, cache_tag, context_tag, id, B} <: Function
5355
body::B
5456
function RuntimeGeneratedFunction(cache_tag, context_tag, ex; opaque_closures = true)
@@ -117,7 +119,9 @@ function RuntimeGeneratedFunction(cache_module::Module, context_module::Module,
117119
opaque_closures = opaque_closures)
118120
end
119121

120-
"$_rgf_docs"
122+
"""
123+
$_rgf_docs
124+
"""
121125
macro RuntimeGeneratedFunction(code)
122126
quote
123127
RuntimeGeneratedFunction(@__MODULE__, @__MODULE__, $(esc(code)))
@@ -332,11 +336,11 @@ end
332336

333337
function get_expression(rgf::RuntimeGeneratedFunction{argnames, cache_tag,
334338
context_tag, id, B}) where {
335-
argnames,
336-
cache_tag,
337-
context_tag,
338-
id,
339-
B
339+
argnames,
340+
cache_tag,
341+
context_tag,
342+
id,
343+
B
340344
}
341345
func_expr = Expr(:->, Expr(:tuple, argnames...), _lookup_body(cache_tag, id))
342346
end

test/runtests.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ GC.gc()
102102
@test f_gc(1, -1) == 100001
103103

104104
# Test that drop_expr works
105-
f_drop1, f_drop2 = let
105+
f_drop1,
106+
f_drop2 = let
106107
ex = Base.remove_linenums!(:(x -> x - 1))
107108
# Construct two identical RGFs here to test the cache deduplication code
108109
(drop_expr(@RuntimeGeneratedFunction(ex)),
@@ -119,8 +120,9 @@ for k in 1:4
119120
t = Threads.@spawn begin
120121
r = Bool[]
121122
for i in 1:100
122-
f = @RuntimeGeneratedFunction(Base.remove_linenums!(:((x, y) -> x + y +
123-
$i * $k)))
123+
f = @RuntimeGeneratedFunction(Base.remove_linenums!(:((
124+
x, y) -> x + y +
125+
$i * $k)))
124126
x = 1
125127
y = 2
126128
push!(r, f(x, y) == x + y + i * k)

0 commit comments

Comments
 (0)