From 488af5b8f7e3cac76d0c12490640432a148233fa Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 5 Apr 2017 14:03:48 +0300 Subject: [PATCH] small cleanup --- lib/vool/compiler.rb | 5 +++-- lib/vool/statements.rb | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/vool/compiler.rb b/lib/vool/compiler.rb index 92c854e8..21a1f20f 100644 --- a/lib/vool/compiler.rb +++ b/lib/vool/compiler.rb @@ -190,8 +190,9 @@ module Vool private def simplify_condition( cond ) - return unless cond.condition.is_a?(ScopeStatement) - cond.condition = cond.condition.first if cond.condition.single? + condition = cond.condition + return unless condition.is_a?(ScopeStatement) + cond.condition = condition.first if condition.single? end def instance_name sym diff --git a/lib/vool/statements.rb b/lib/vool/statements.rb index 462ffa46..ffe841e5 100644 --- a/lib/vool/statements.rb +++ b/lib/vool/statements.rb @@ -13,6 +13,9 @@ module Vool def first @statements.first end + def length + @statements.length + end end class ScopeStatement < Statements