New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Write more test suites #89

Merged
merged 34 commits into from Sep 7, 2016
Commits
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+12 −6
Diff settings

Always

Just for now

Visitor: If the model is empty, compile to `''`.

  • Loading branch information...
Hywan committed Sep 2, 2016
commit d77bd4e2e0c808006cf3275290546e8b3d2e907c
Copy path View file
@@ -73,13 +73,19 @@ public function visit(Visitor\Element $element, &$handle = null, $eldnah = null)
$_ = str_repeat(' ', $this->_indentation);
if ($element instanceof Ruler\Model) {
$this->_indentation = 1;
$expression = $element->getExpression();
$out =
'$model = new \Hoa\Ruler\Model();' . "\n" .
'$model->expression =' . "\n" .
$element->getExpression()->accept($this, $handle, $eldnah) .
';';
if (null === $expression) {
$out = '';
} else {
$this->_indentation = 1;
$out =
'$model = new \Hoa\Ruler\Model();' . "\n" .
'$model->expression =' . "\n" .
$expression->accept($this, $handle, $eldnah) .
';';
}
} elseif ($element instanceof Ruler\Model\Operator) {
$out = $_ . '$model->';
$name = $element->getName();
ProTip! Use n and p to navigate between commits in a pull request.