<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
{assign var="test" value=1}
{while ($test <= 5)}
{assign var="test" value="`$test+1`"}
jo
{endwhile}
*/

function smarty_compiler_while($tag_arg, &$smarty) {
  $res = $smarty->_compile_if_tag($tag_arg);
  preg_match("/<\?php if (.*): \?>/",$res,$token);
  return "while " . $token[1] . " {";
}

?>