Handle syntax errors in expression