Add check for unmatched parenthesis in the conditions.

Added a method Parser.check_parens() that counts the number of ( and ) and raises an error if
they are not the same.

Parser.parse_conditions() no calls check_parens() before executing.