add comments in variable_info
optimize variable_info

we now don't  check for '.', '[', ']' twice.