All pastes #460740 Raw Edit

Mine

public ruby v1 · immutable
#460740 ·published 2007-04-27 07:43 UTC
rendered paste body
STDIN.readlines.each{|l| l.sub(/\/\/.*/,"")}.join("").gsub(/"[^"\\]*(\\.[^"\\]*)*"/,"").split("\n").each {|l|	f = l.slice(/^\s*function\s+\w+/)	if l =~ /^\s*globals/ then		@func = "globals"		@calls[@func] = {} unless @calls.has_key?(@func)	elsif f == nil then		calls = l.scan(/\w+\s*\(/).each {|f| f = f.scan(/\w+/)[0]; @calls[@func][f] = true unless keywords.has_key?(f)}	else		@func = f.slice(/\w+$/)		@calls[@func] = {}	end}