_registry_skip_body(&$tokens)
drupal/includes/registry.inc, line 240
Skip the body of a code block, as defined by { and }.
This function assumes that the body starts at the next instance of { from the current position.
$tokens
| Name | Description |
|---|---|
| Code registry | The code registry engine. |
function _registry_skip_body(&$tokens) {
$num_braces = 1;
$token = '';
// Get to the first open brace.
while ($token != '{' && ($token = next($tokens)));
// Scan through the rest of the tokens until we reach the matching
// end brace.
while ($num_braces && ($token = next($tokens))) {
if ($token == '{') {
++$num_braces;
}
elseif ($token == '}') {
--$num_braces;
}
}
}