From: <ha...@us...> - 2007-07-24 14:22:51
|
Revision: 8005 http://svn.sourceforge.net/jmol/?rev=8005&view=rev Author: hansonr Date: 2007-07-24 07:22:46 -0700 (Tue, 24 Jul 2007) Log Message: ----------- 11.3.6 # bug fix: nested ifs can cause last endif to throw error # bug fix: compiler bug working with very small real numbers Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Compiler.java trunk/Jmol/src/org/jmol/viewer/Eval.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/viewer/Compiler.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Compiler.java 2007-07-24 14:22:05 UTC (rev 8004) +++ trunk/Jmol/src/org/jmol/viewer/Compiler.java 2007-07-24 14:22:46 UTC (rev 8005) @@ -110,7 +110,11 @@ if (pt > 0 && (i = Integer.parseInt(strDecimal.substring(0, pt))) < 0) i = -i; if (pt < strDecimal.length() - 1) - j = Integer.parseInt(strDecimal.substring(pt + 1)); + try { + j = Integer.parseInt(strDecimal.substring(pt + 1)); + } catch(NumberFormatException e) { + // not a problem + } return i * 1000000 + j; } Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2007-07-24 14:22:05 UTC (rev 8004) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2007-07-24 14:22:46 UTC (rev 8005) @@ -758,13 +758,14 @@ switch (token.tok) { case Token.ifcmd: for (int i = 1; i <= ifLevel; i++) - if (ifs[ifLevel] == pc || ifs[ifLevel] == -1 - pc) { + if (ifs[i] == pc || ifs[i] == -1 - pc) { ifLevel = i - 1; break; } if (++ifLevel == MAX_IF_DEPTH) evalError(GT._("Too many nested {0} commands", "IF")); ifs[ifLevel] = (ifs[ifLevel - 1] >= 0 && ifCmd() ? pc : -1 - pc); + //System.out.println("if " + ifLevel + " = " + ifs[ifLevel]); break; case Token.elsecmd: if (ifLevel < 1) @@ -773,6 +774,7 @@ ifs[ifLevel] = -1 - ifs[ifLevel]; break; case Token.endifcmd: + //System.out.println("if " + pc +" " + ifLevel); if (--ifLevel < 0) evalError(GT._("Invalid {0} command", "ENDIF")); break; Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2007-07-24 14:22:05 UTC (rev 8004) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2007-07-24 14:22:46 UTC (rev 8005) @@ -4,6 +4,8 @@ # bug fix: dots not available in multimodel mode # bug fix: multiple isosurface cavities incorrect in a multimodel environment # bug fix: isosurface cavity not filled completely +# bug fix: nested ifs can cause last endif to throw error +# bug fix: compiler bug working with very small real numbers # ----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |