Class: Liquidscript::Compiler::ICR

Inherits:
Base
  • Object
show all
Includes:
Classes, Expressions, Functions, Helpers, Literals
Defined in:
lib/liquidscript/compiler/icr.rb,
lib/liquidscript/compiler/icr/classes.rb,
lib/liquidscript/compiler/icr/helpers.rb,
lib/liquidscript/compiler/icr/literals.rb,
lib/liquidscript/compiler/icr/functions.rb,
lib/liquidscript/compiler/icr/expressions.rb

Defined Under Namespace

Modules: Classes, Expressions, Functions, Helpers, Literals

Instance Method Summary collapse

Methods included from Helpers

#code, #ref, #set

Methods included from Classes

#_compile_class_body, #_compile_class_body_key, #compile_class, #compile_module

Methods included from Literals

#compile_array, #compile_function, #compile_function_with_parameters, #compile_identifier, #compile_istring, #compile_istring_begin, #compile_keyword, #compile_newline, #compile_number, #compile_object, #compile_object_key, #compile_operator, #compile_sstring

Methods included from Functions

#compile_call, #compile_property

Methods included from Expressions

#compile_assignment, #compile_binop, #compile_else, #compile_expression, #compile_lparen, #compile_unless, #compile_unop, #compile_vexpression

Methods inherited from Base

#compile, #compile?, #initialize, #peek, #pop, #scanner_nil

Methods included from Base::Helpers

#action, #collect_compiles, #expect, #loop, #maybe, #peek?, #shift

Constructor Details

This class inherits a constructor from Liquidscript::Compiler::Base

Instance Method Details

#compile_startICR::Code

Sets the starting point for compiliation.

Returns:



33
34
35
# File 'lib/liquidscript/compiler/icr.rb', line 33

def compile_start
  compile_expression
end

#reset!void

This method returns an undefined value.

Resets the state of the compiler.



18
19
20
21
22
23
# File 'lib/liquidscript/compiler/icr.rb', line 18

def reset!
  @top         = Liquidscript::ICR::Set.new
  @top.context = Liquidscript::ICR::Context.new
  @set         = [@top]
  super
end

#topArray, #push

Returns the top set. If the variable @top isn’t set by the inheriting class, then it defaults to the value of an array.

Returns:



26
27
28
# File 'lib/liquidscript/compiler/icr.rb', line 26

def top
  @set.last
end