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_dstring, #compile_function, #compile_function_with_parameters, #compile_identifier, #compile_keyword, #compile_number, #compile_object, #compile_object_key, #compile_sstring

Methods included from Functions

#compile_call, #compile_property

Methods included from Expressions

#compile_assignment, #compile_expression, #compile_lparen

Methods inherited from Base

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

Methods included from Base::Helpers

#action, #expect, included, #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:



35
36
37
# File 'lib/liquidscript/compiler/icr.rb', line 35

def compile_start
  expect :class, :module, :_ => :expression
end

#reset!void

This method returns an undefined value.

Resets the state of the compiler.



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

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:



28
29
30
# File 'lib/liquidscript/compiler/icr.rb', line 28

def top
  @set.last
end