parsing ending parentheses with as terms