Local keyword semantics

1. Semantic implementation of local variables
2. Testcases for local
Please can you also verify a at global scope