Sha256: ce854595538399377fa394b10a89900ba2c54df5efcf7bbdc6267693a88f85db

Contents?: true

Size: 463 Bytes

Versions: 4

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

# A mixin for visitors that stops them from visiting other scopes.

module Phlex::Compiler::Visitors::StableScope
	def visit_class(node)
		nil
	end

	def visit_module(node)
		nil
	end

	def visit_brace_block(node)
		nil
	end

	def visit_do_block(node)
		nil
	end

	def visit_method_add_block(node)
		node = Phlex::Compiler::Nodes::MethodAddBlock.new(node)
		if node.method_call.name == :render
			visit(node.content)
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phlex-0.5.3 lib/phlex/compiler/visitors/stable_scope.rb
phlex-0.5.2 lib/phlex/compiler/visitors/stable_scope.rb
phlex-0.5.1 lib/phlex/compiler/visitors/stable_scope.rb
phlex-0.5.0 lib/phlex/compiler/visitors/stable_scope.rb