Sha256: 202fe544af80436d2e2816ced513078ffd91dce6fab8e53909796000e0be0ce8
Contents?: true
Size: 1.38 KB
Versions: 17
Compression:
Stored size: 1.38 KB
Contents
require "liquidscript/compiler/icr/expressions" require "liquidscript/compiler/icr/functions" require "liquidscript/compiler/icr/literals" require "liquidscript/compiler/icr/classes" require "liquidscript/compiler/icr/helpers" require "liquidscript/compiler/icr/heredoc" module Liquidscript module Compiler class ICR < Base include Expressions include Functions include Literals include Classes include Helpers # (see Base#initialize) def initialize(*) super handle_directives end # (see Base#reset!) def reset! @top = Liquidscript::ICR::Set.new @top.context = Liquidscript::ICR::Context.new @set = [@top] super end # (see Base#top) def top @set.last end # Sets the starting point for compiliation. # # @return [ICR::Code] def compile_start compile_expression end private def handle_directives return unless @scanner.metadata[:directives] @scanner.metadata[:directives].each do |meta| case meta[:command] when "allow" variables = meta[:args].split(' ') variables.each { |v| top.context.allow(v.intern) } else raise UnknownDirectiveError.new(meta[:command]) end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems