Rule Access Macros
You can use the following macros in either the test statement or the rules commands of the SK_RULE macro:
|
Rule Access Macro
|
Description
|
|
SK_ARGS()
|
Returns the list of the arguments to the function call under test. This macro takes no arguments. The list values returned by this macro should never be destructively altered (using rplaca etc.) because that would produce unknown effects.
|
|
SK_CUR_FILENAME()
|
Returns the name of file currently being checked in a SKILL Lint rule. For example:
SK_RULE( test t printf( "Current file being checked is: ’%s’\n" SK_CUR_FILENAME() ) )
|
|
SK_NTH_ARG(n)
|
Returns the specified argument number (n) in the function call. n is zero-based: 0 is the first argument to the function call; 1 is the second argument, etc. You must not destructively alter the list values returned by this macro (for example, using rplaca) because that would produce unknown effects.
|
|
SK_FUNCTION()
|
Returns the name of the function call under test. You might want to establish the function name where the same rule is being used for several different functions. You must not destructively alter the list values returned by this macro (for example, using rplaca) because that would produce unknown effects.
|
|
SK_FORM([n])
|
Returns the entire function call under test as a list. If you specify n, this macro returns the call n levels up the call stack. For example, if an if is called in a foreach that is in a let, SK_FORM(2) returns the call to let.
You must not destructively alter the list values returned by this macro (for example, using rplaca) because that would produce unknown effects.
|
Related Topics
SKILL Lint Rules
Rule Reporting Macros
Advanced Rule Macros
Return to top