node/lib/metasm/samples/dynamic_ruby.rb
# checks if ast maps to a constant, returns it if it does
checks if ast maps to a constant, returns it if it does
checks if ast maps to a constant returns it if it does
def check_const(ast)
		case ast[0]
		when :const
			resolve_const_owner(ast[1])
		when :colon2
			if cst = check_const(ast[1])
				cst.const_get(ast[2])
			end
		when :colon3
			::Object.const_get(ast[2])
		end
	end
def check_const ( ast ) case ast [ 0 ] when :const resolve_const_owner ( ast [ 1 ] ) when :colon2 if cst = check_const ( ast [ 1 ] ) cst . const_get ( ast [ 2 ] ) end when :colon3 :: Object . const_get ( ast [ 2 ] ) end end
checks if ast maps to a constant, returns it if it does
checks if ast maps to a constant returns it if it does
ast