scope analyser for the Shift AST