save scope for every ast node