if(FALSE)
block.For if(FALSE)
documentation blocks, such as
@testing
and @example
blocks, a user may supply an
information string which gives the name information for tests and
examples. for example, in if(FALSE)\{#@test my special test
the information string is "my special test".
The more common case is when there is no information string. In these cases the name is inferred by the previous assignment or declaration.
The id
argument should identify one and only one
if(FALSE)
block, but as this is an internal
function, argument checks are not performed.
pd_get_iff_associated_name_id(id, pd, .check = TRUE)
id of the expression of interest
The parse-data
information
Perform checks for input validation?
IFF blocks can be placed
sequentially and pd_get_iff_associated_name_id
will
navigate back until it finds a non-IFF block to use for the name.
This way users can place multiple tests and examples after a
declaration.
If the previous expression is an assignment, the assignee variable of
the assignment is chosen as the name.
An attribute 'type' is also set on the return value.
For function assignments type="function_assignment"
,
for all other assignments type="assignment"
.
The names for link{setClass}
calls will also be inferred.
The name of the class is taken as the name, but the
return value also has the attribute of
type="setClass"
.
Note that it is common to assign the result of
setClass
to a variable, which may or
may not match the class name. In those cases the
assignment operation takes priority and would have
type="assignment"
.
The names for setMethod
will assume
the S3 convention of <method>.<class>
.
In the case the the signature is more than just the class,
the signature will be collapsed, separated by commas.
the type attribute will be set to "setMethod"
.
setGeneric
can also be used with the name
of the generic function the inferred name and
type="setGeneric"
.
setAs
infers coerce methods.
type="setAs"
.