Method CompilerEnvironment()->PikeCompiler()->apply_attribute_constant()
- Method
apply_attribute_constant
type
apply_attribute_constant(string
attr
,mixed
value
,type
arg_type
,void
cont_type
,mapping
state
)- Description
Handle constant arguments to attributed function argument types.
- Parameter
attr
Attribute that
arg_type
had.- Parameter
value
Constant value sent as parameter.
- Parameter
arg_type
Declared type of the function argument.
- Parameter
cont_type
Continuation function type after the current argument.
- Parameter
state
Mapping intended to hold state during checking of multiple arguments.
This function is called when a function is called with the constant value
value
and it has been successfully matched againstarg_type
, andarg_type
had the type attributeattr
.This function is typically used to perform specialized argument checking and to allow for a strengthening of the function type based on
value
.The default implementation handles the following attributes:
This marks the arguments to sprintf().
These mark arguments that will be sent as the first argument to sprintf().
This marks the return value for sprintf().
sscanf_format
andsscanf_76_format
These mark arguments that will be sent as the second argument to sscanf().
sscanf_input
This is the input for sscanf().
- Returns
Returns a continuation type if it succeeded in strengthening the type.
Returns UNDEFINED otherwise (this is not an error indication).
- See also