#!/usr/bin/env ascript
listSymbols(skipWords:list, indent:number => 0, m?:module) = {
	skipWordsMap = %{
		"sys" => ["stdin", "stdout", "stderr", "path", "argv",
				"executable", "build", "datadir", "libdir"]
		"path" => ["sep"]
	}
	for (word in dir(m)) {
		if (word in skipWords) { continue }
		value = locals(m).lookup(tosymbol(word))
		printf("%*s%s:%s = %s\n", indent * 2, "", word, typename(value), value)
		if (ismodule(value)) {
			listSymbols(skipWordsMap.get(word, []), indent + 1, value)
		}
	}
}
listSymbols(["break", "return", "continue", "listSymbols", "*"])
