lib/Lexy.php
protected function compile_default_structures($value) {

        $value = preg_replace('/(?(R)\((?:[^\(\)]|(?R))*\)|(?<!\w)(\s*)@(if|foreach|for|while)(\s*(?R)+))/', '$1<?php $2 $3 { ?>', $value);
        $value = preg_replace('/(\s*)@elseif(\s*\(.*\))/', '$1<?php } elseif$2 { ?>', $value);
        $value = preg_replace('/(\s*)@(endif|endforeach|endfor|endwhile)(\s*)/', '$1<?php } ?>$3', $value);
        $value = preg_replace('/(\s*)@(end)(\s*)/', '$1<?php } ?>$3', $value);

        return $value;
    }
protected function compile_default_structures($value) {

        $value = preg_replace('/(?(R)\((?:[^\(\)]|(?R))*\)|(?<!\w)(\s*)@(if|foreach|for|while)(\s*(?R)+))/', '$1<?php $2 $3 { ?>', $value);
        $value = preg_replace('/(\s*)@elseif(\s*\(.*\))/', '$1<?php } elseif$2 { ?>', $value);
        $value = preg_replace('/(\s*)@(endif|endforeach|endfor|endwhile)(\s*)/', '$1<?php } ?>$3', $value);
        $value = preg_replace('/(\s*)@(end)(\s*)/', '$1<?php } ?>$3', $value);

        return $value;
    }
protected function compile_default_structures ( $ value ) { $ value = preg_replace ( '/(?(R)\((?:[^\(\)]|(?R))*\)|(?<!\w)(\s*)@(if|foreach|for|while)(\s*(?R)+))/' , '$1<?php $2 $3 { ?>' , $ value ) ; $ value = preg_replace ( '/(\s*)@elseif(\s*\(.*\))/' , '$1<?php } elseif$2 { ?>' , $ value ) ; $ value = preg_replace ( '/(\s*)@(endif|endforeach|endfor|endwhile)(\s*)/' , '$1<?php } ?>$3' , $ value ) ; $ value = preg_replace ( '/(\s*)@(end)(\s*)/' , '$1<?php } ?>$3' , $ value ) ; return $ value ; }
Rewrites Lexi's structure openings into PHP structure openings.

@param  string  $value
@return string
Rewrites Lexi s structure openings into PHP structure openings .