Added testing in compilation logic of variable declarations whether a
variable has already been declared in the local scope.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>