lib/liquidscript/compiler/icr/helpers.rb in liquidscript-0.11.0.rc1 vs lib/liquidscript/compiler/icr/helpers.rb in liquidscript-0.11.0
- old
+ new
@@ -9,10 +9,17 @@
def set(literal)
top.context.set(literal.value.intern)
end
+ def check(literal)
+ top.context.get(literal.value.intern,
+ :dry_run => true)
+ rescue InvalidReferenceError
+ false
+ end
+
def code(type, *args)
Liquidscript::ICR::Code.new type, *args
end
def _compile_block
@@ -29,9 +36,10 @@
:lparen => action { compile_call(v) },
:equal => action { compile_assignment(v) },
:prop => action { compile_property(v) },
:lbrack => action { compile_access(v) },
:range => action { |_| compile_range(v) },
+ :erange => action { |_| compile_erange(v) },
[:binop,
:minus,
:plus] => action { compile_binop(v) },
:unop => action { |o| code :op, v, o },
:_ => default || action { v }