Fix bug in lexer

Previously the lexer could get stuck parsing inputs including
substrings such as "[1]"
Fix reg alloc in `var` rule.
Implement table constructor

This does not handle an edge case where the size of the initial array
list is extremely large.