From c371aa983df748ffb40601215eaa99ef8656bba2 Mon Sep 17 00:00:00 2001 From: "Amol S. Deshmukh" Date: Thu, 24 Aug 2006 16:42:52 +0000 Subject: [PATCH] 1. when formula parse fails, reported error now includes the "pointer" 2. added the case of interpreting a missing argument as MissingArgPtg git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@434426 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hssf/model/FormulaParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/hssf/model/FormulaParser.java b/src/java/org/apache/poi/hssf/model/FormulaParser.java index ae2b14a54..0be6488e6 100644 --- a/src/java/org/apache/poi/hssf/model/FormulaParser.java +++ b/src/java/org/apache/poi/hssf/model/FormulaParser.java @@ -110,7 +110,7 @@ public class FormulaParser { private void Abort(String s) { Error(s); //System.exit(1); //throw exception?? - throw new RuntimeException("Cannot Parse, sorry : "+s + " [Formula String was: '"+formulaString+"']"); + throw new RuntimeException("Cannot Parse, sorry : " + s + " @ " + pointer + " [Formula String was: '" + formulaString + "']"); } @@ -493,6 +493,8 @@ public class FormulaParser { Ident(); } else if(look == '"') { StringLiteral(); + } else if (look == ')' || look == ',') { + tokens.add(new MissingArgPtg()); } else { String number = GetNum();