Talesoft / tale-jade

A complete and fully-functional implementation of the Jade template language for PHP
http://jade.talesoft.codes
MIT License
88 stars 10 forks source link

Variadics bug #61

Closed elquimista closed 8 years ago

elquimista commented 8 years ago

Reporting variadics bug here:

mixin post-list(...posts)
    each $post in $posts
        header= $post->title
        article= $post->content

+post-list($post1, $post2, $post3, $post4)

The above jade code throws php error when compiled. In fact, I see the unwanted semicolon in the following:

<?php $__args = isset($__args) ? $__args : [];?>
<?php $__mixins = [];?>
<?php $__mixins['post-list'] = function(array $__arguments) use($__args, $__mixins) {
  static $__defaults = ['posts' => array_slice($__arguments, 0);];
  $__arguments = array_replace($__defaults, $__arguments);
  $__args = array_replace($__args, $__arguments);
  extract($__args);

?>
...
TorbenKoehn commented 8 years ago

Okay, I just wanted to release 1.4.0, I'll wait until I fixed that one :)

TorbenKoehn commented 8 years ago

Please update to 1.4.0 and tell me if it's fixed please :)

https://github.com/Talesoft/tale-jade/releases/tag/1.4.0

elquimista commented 8 years ago

Thanks. Variadics now works okay