File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 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
66Libtask.might_produce
77Libtask.stmt_might_produce
88Libtask.LazyCallable
9+ Libtask.inc_args
910```
Original file line number Diff line number Diff line change @@ -288,10 +288,14 @@ end
288288@inline Base. getindex (x:: ProducedValue ) = x. x
289289
290290"""
291- inc_args(stmt)
291+ inc_args(stmt::T)::T where {T}
292292
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+ ```
295299"""
296300inc_args (x:: Expr ) = Expr (x. head, map (__inc, x. args)... )
297301inc_args (x:: ReturnNode ) = isdefined (x, :val ) ? ReturnNode (__inc (x. val)) : x
You can’t perform that action at this time.
0 commit comments