Revision: 20809
          http://sourceforge.net/p/jmol/code/20809
Author:   hansonr
Date:     2015-10-06 13:13:45 +0000 (Tue, 06 Oct 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.16_2015.10.06"

bug fix: better error reporting

new feature: load =aflow/AgAu
 -- easy access to binary metal alloy CIF files
 
bug fix: braceless if/for fix from 10.04

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/script/ScriptCompiler.java
    trunk/Jmol/src/org/jmol/script/ScriptFunction.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/org/jmol/script/ScriptCompiler.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptCompiler.java  2015-10-06 04:55:57 UTC 
(rev 20808)
+++ trunk/Jmol/src/org/jmol/script/ScriptCompiler.java  2015-10-06 13:13:45 UTC 
(rev 20809)
@@ -366,22 +366,25 @@
         if (ichToken < cchScript)
           continue;
         if (flowContext != null) {
-          ichCurrentCommand = cchScript;
+          ichCurrentCommand = ichToken = cchScript;
           while (flowContext != null) {
             fixFlowAddLine(flowContext);
             if (flowContext.checkForceEndIf(0)) {
               forceFlowEnd(flowContext.token);
-              ichCurrentCommand = cchScript;
               processTokenList(iLine, isFull);
             } else {
-              flowContext = flowContext.parent;
-            }
+              lineCurrent = (short) flowContext.lineStart; 
+              iCommand = flowContext.pt0;
+              ichCurrentCommand = lineIndices[iCommand][0];
+              ichToken = ichEnd = lineIndices[iCommand][1];
+              return errorStr(ERROR_missingEnd,
+                      (flowContext.function == null ? 
T.nameOf(flowContext.token.tok)
+                          : flowContext.function.getSignature()));            }
           }
           lltoken.addLast(new T[]{T.o(T.nada, "// end of script")});
         }
         setAaTokenCompiled();
-        return (flowContext == null || errorStr(ERROR_missingEnd,
-            T.nameOf(flowContext.token.tok)));
+        return true;
       }
 
       if (nTokens > 0 && !isDotDot) {
@@ -758,7 +761,7 @@
             lineIndices = lnI;
             lnLength *= 2;
           }
-          lineNumbers[iCommand] = iLine;
+          lineNumbers[iCommand] = lineNumbers[lineNumbers.length - 1] = iLine;
           lineIndices[iCommand][0] = ichCurrentCommand;
           lineIndices[iCommand][1] = Math.max(ichCurrentCommand, Math.min(
               cchScript, ichEnd == ichCurrentCommand ? ichToken : ichEnd));
@@ -798,8 +801,8 @@
         isEndOfCommand = true;
         cchToken = 0;
         ichCurrentCommand = ichToken;
-        if (n > 0 || isOneLine)
-          lineCurrent--;
+//        if (n > 0 || isOneLine)
+  //        lineCurrent--;
         return CONTINUE;
       }
       isComment = false;
@@ -2914,7 +2917,7 @@
   private boolean handleError() {
     errorType = errorMessage;
     errorLine = script.substring(ichCurrentCommand,
-        ichEnd <= ichCurrentCommand ? ichToken : ichEnd);
+        ichEnd <= ichCurrentCommand ? ichToken + cchToken : ichEnd);
     String lineInfo = (ichToken < ichEnd ? errorLine.substring(0, ichToken
         - ichCurrentCommand)
         + " >>>> " + errorLine.substring(ichToken - ichCurrentCommand)

Modified: trunk/Jmol/src/org/jmol/script/ScriptFunction.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptFunction.java  2015-10-06 04:55:57 UTC 
(rev 20808)
+++ trunk/Jmol/src/org/jmol/script/ScriptFunction.java  2015-10-06 13:13:45 UTC 
(rev 20809)
@@ -182,6 +182,8 @@
 
   @Override
   public String getSignature() {
+    if (typeName == null)
+      return T.nameOf(tok);
     SB s = new SB().append(typeName)
       .append(" ").append(name).append(" (");
     for (int i = 0; i < nParameters; i++) {

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-10-06 04:55:57 UTC 
(rev 20808)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-10-06 13:13:45 UTC 
(rev 20809)
@@ -62,8 +62,10 @@
 TODO: consider if models with no atoms will cause issues in relation to 
model.firstAtomIndex
 
 
-Jmol.___JmolVersion="14.3.16_2015.10.05"
+Jmol.___JmolVersion="14.3.16_2015.10.06"
 
+bug fix: better error reporting
+
 new feature: load =aflow/AgAu
  -- easy access to binary metal alloy CIF files
  

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to