All pastes #460738 Raw Edit

Mine

public text v1 · immutable
#460738 ·published 2007-04-27 07:42 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
}