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/heredoc.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 Classes: Heredoc

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_for_in, #_compile_for_seg, #compile_action, #compile_array, #compile_for, #compile_function, #compile_function_with_parameters, #compile_heredoc, #compile_href, #compile_identifier, #compile_iheredoc_begin, #compile_istring, #compile_istring_begin, #compile_keyword, #compile_newline, #compile_number, #compile_object, #compile_object_key, #compile_operator, #compile_regex, #compile_sstring, #compile_while

Methods included from Functions

#compile_access, #compile_call, #compile_property

Methods included from Expressions

#_compile_catch, #_compile_finally, #compile_assignment, #compile_binop, #compile_else, #compile_expression, #compile_lparen, #compile_minus, #compile_plus, #compile_try, #compile_unless, #compile_unop, #compile_vexpression

Methods inherited from Base

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

Methods included from Base::Helpers

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

Constructor Details

#initializeObject

Initializes the compiler.



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

def initialize(*)
  super

  handle_directives
end

Instance Method Details

#compile_startICR::Code

Sets the starting point for compiliation.



41
42
43
# File 'lib/liquidscript/compiler/icr.rb', line 41

def compile_start
  compile_expression
end

#reset!void

This method returns an undefined value.

Resets the state of the compiler.



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

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.



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

def top
  @set.last
end