static function pseudo_patch($fragment, $root, $command, $args, $bracket, $params) { /* @css-patch name { } */ if (!$bracket || !preg_match('/^\\s*([\\w-]+)\\s*$/', $args, $matches)) { $fragment->trace($root, '格式错误: @css-patcher name{}'); return FALSE; } $name = $matches[1]; $pos = $fragment->get_var($name); if ($pos === NULL) { $fragment->trace($root, '未定义的补丁: ' . $name); return FALSE; } CSSP::register_rule_patcher('*', 'CSSP_BuildIn::do_patch', array('patcher_pos' => $pos), 'do_patch'); $fragment->parse_content($root); CSSP::unregister_rule_patcher('*', 'do_patch'); }