function calc(expression) {
  let result
  try {
    result = parser.evaluate(expression)
  } catch (error) {
    result = error.toString()
  }
  return result
}
Evaluates a given expression using a parser.

@param {string} expression - The expression to evaluate.
@returns {any} The result of the evaluation, or the error message if an error occurred.