File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ Libtask.is_produce_stmt
6
6
Libtask.might_produce
7
7
Libtask.stmt_might_produce
8
8
Libtask.LazyCallable
9
+ Libtask.inc_args
9
10
```
Original file line number Diff line number Diff line change @@ -288,10 +288,14 @@ end
288
288
@inline Base. getindex (x:: ProducedValue ) = x. x
289
289
290
290
"""
291
- inc_args(stmt)
291
+ inc_args(stmt::T)::T where {T}
292
292
293
- Increment by `1` the `n` field of any `Argument`s present in `stmt`.
294
- Used in `make_ad_stmts!`.
293
+ Returns a new `T` which is equal to `stmt`, except any `Argument`s present in `stmt` are
294
+ incremented by `1`. For example
295
+ ```jldoctest
296
+ julia> Libtask.inc_args(Core.ReturnNode(Core.Argument(1)))
297
+ :(return _2)
298
+ ```
295
299
"""
296
300
inc_args (x:: Expr ) = Expr (x. head, map (__inc, x. args)... )
297
301
inc_args (x:: ReturnNode ) = isdefined (x, :val ) ? ReturnNode (__inc (x. val)) : x
You can’t perform that action at this time.
0 commit comments