semantic: Update scope handling for function local variables.