]> source.dussan.org Git - poi.git/commitdiff
1. when formula parse fails, reported error now includes the "pointer"
authorAmol S. Deshmukh <amol@apache.org>
Thu, 24 Aug 2006 16:42:52 +0000 (16:42 +0000)
committerAmol S. Deshmukh <amol@apache.org>
Thu, 24 Aug 2006 16:42:52 +0000 (16:42 +0000)
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

index ae2b14a54e6235d0d4f7c673f8a2ad794b9b48f0..0be6488e6853840bd4a71b1a1123c53eb6edda73 100644 (file)
@@ -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();