lib/liquidscript/compiler/icr/functions.rb in liquidscript-0.9.2 vs lib/liquidscript/compiler/icr/functions.rb in liquidscript-0.10.0

- old
+ new

@@ -9,23 +9,19 @@ property = action do |ident| code :property, prop, (ident.value || ident.type) end # Just in case there is a property named 'class' or 'module' - v = expect [:identifier, :class, :module] => property - - v + expect [:identifier, :class, :module] => property end def compile_access(body) shift :lbrack key = compile_vexpression shift :rbrack - v = code :access, body, key - - v + code :access, body, key end def compile_call(subject) shift :lparen @@ -34,12 +30,11 @@ end arguments = collect_compiles :expression, :rparen, :comma => action.shift - call = code :call, subject, *arguments - call + code :call, subject, *arguments end def compile_function_with_parameters(parameters) shift :arrow @@ -58,13 +53,13 @@ code :function, @set.pop end private - def _build_set(parameters) + def _build_set(parameters = []) expressions = Liquidscript::ICR::Set.new expressions.context = Liquidscript::ICR::Context.new - expressions.context.parent = top.context + expressions.context.parents << top.context expressions[:arguments] = parameters @set << expressions parameters.each do |parameter| set(parameter).parameter!