Revision: 20427 http://sourceforge.net/p/jmol/code/20427 Author: hansonr Date: 2015-04-01 19:23:22 +0000 (Wed, 01 Apr 2015) Log Message: ----------- Jmol.___JmolVersion="14.3.13_2015.04.01b"
bug fix: hash values created from named int variables do not clone properly bug fix: hash[key1]..key2.push() does not work properly bug fix: show hash where one of the elements is an empty hash ignores that key bug fix: local var xxx with same name of ..xxx forces lower case xxx Modified Paths: -------------- trunk/Jmol/src/org/jmol/script/SV.java trunk/Jmol/src/org/jmol/script/ScriptExpr.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/script/SV.java =================================================================== --- trunk/Jmol/src/org/jmol/script/SV.java 2015-04-01 12:06:16 UTC (rev 20426) +++ trunk/Jmol/src/org/jmol/script/SV.java 2015-04-01 19:23:22 UTC (rev 20427) @@ -714,8 +714,8 @@ for (int i = 0; i < keys.length; i++) { String key = keys[i]; SV val = ht.get(key); - if (skipEmpty && val.tok == T.varray && val.getList().size() == 0 - || val.tok == T.hash && val.getMap().isEmpty()) + if (skipEmpty && (val.tok == T.varray && val.getList().size() == 0 + || val.tok == T.hash && val.getMap().isEmpty())) continue; if (addValues) sb.append(sep).append(PT.esc(key)).append(":"); @@ -860,7 +860,8 @@ case string: break; default: - return tokenIn; + return ((tokenIn instanceof SV) && ((SV) tokenIn).myName != null ? newI(0) + .setv((SV) tokenIn) : tokenIn); } // negative number is a count from the end @@ -893,7 +894,7 @@ } break; case barray: - len = ((BArray)(((SV) tokenIn).value)).data.length; + len = ((BArray) (((SV) tokenIn).value)).data.length; break; case varray: len = ((SV) tokenIn).getList().size(); @@ -982,12 +983,12 @@ } else if (i1 == 1) { // {xxx}[1] i2 = bs.nextSetBit(0); - } + } if (i2 >= -1) { bs.clearAll(); if (i2 >= 0) bs.set(i2); - break; + break; } i2 = i1; } @@ -1007,7 +1008,7 @@ return ((SV) tokenIn).getList().get(i1); Lst<SV> o2 = new Lst<SV>(); Lst<SV> o1 = ((SV) tokenIn).getList(); - + int nn = Math.min(i2, len) - i1; for (int i = 0; i < nn; i++) o2.addLast(newT(o1.get(i + i1))); @@ -1016,7 +1017,7 @@ case barray: if (--i1 < 0 || i1 >= len) return newV(string, ""); - byte[] data = ((BArray)(((SV) tokenIn).value)).data; + byte[] data = ((BArray) (((SV) tokenIn).value)).data; if (isOne) return newI(data[i1]); byte[] b = new byte[Math.min(i2, len) - i1]; @@ -1432,7 +1433,7 @@ * @return array */ public SV pushPop(SV value, SV mapKey) { - if (mapKey != null) { + if (mapKey != null ) { Map<String, SV> m = getMap(); if (value == null) { SV v; Modified: trunk/Jmol/src/org/jmol/script/ScriptExpr.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptExpr.java 2015-04-01 12:06:16 UTC (rev 20426) +++ trunk/Jmol/src/org/jmol/script/ScriptExpr.java 2015-04-01 19:23:22 UTC (rev 20427) @@ -463,11 +463,11 @@ switch (tokAt(i + 1)) { case T.nada: break; //?? or invArg?? + case T.push: + case T.pop: case T.size: case T.keys: case T.type: - case T.push: - case T.pop: if (tok == T.per) break; //$FALL-THROUGH$ @@ -614,8 +614,15 @@ rpn.dumpStacks("null result"); error(ERROR_endOfStatementUnexpected); } - if (result.tok == T.vector) + if (result.tok == T.vector) { + if (isSpecialAssignment && ptEq == 0) { + // no equal sign found! xxxxx.pop() for example + Lst<SV> rv = new Lst<SV>(); + rv.addLast(new SV()); + return rv; + } return result.value; + } if (chk) { if (returnBoolean) return Boolean.TRUE; @@ -2044,7 +2051,7 @@ nv = v.size(); if (nv == 0) invArg(); - if (chk) + if (chk || v.get(0).tok == T.nada) return null; SV tv = SV.selectItemVar(SV.newS("").setv(v.get(nv - 1))); if (nv > 1) { Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2015-04-01 12:06:16 UTC (rev 20426) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2015-04-01 19:23:22 UTC (rev 20427) @@ -14,13 +14,22 @@ TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT command for problems) -Jmol.___JmolVersion="14.3.13_2015.04.01" +Jmol.___JmolVersion="14.3.13_2015.04.01b" +bug fix: hash values created from named int variables do not clone properly +bug fix: hash[key1]..key2.push() does not work properly +bug fix: show hash where one of the elements is an empty hash ignores that key bug fix: local var xxx with same name of ..xxx forces lower case xxx +JmolVersion="14.3.13_2015.04.01" + +bug fix: local var xxx with same name of foo..xxx forces lower case xxx + new feature: draw polygon [@1 @2 @3...] -- fills polygon with triangles - -- order is important -- must be in order cw or ccw + -- order is important -- must be cw or ccw + -- does not have to be convex + -- indeterminate result if atoms are not coplanar -- example: load $caffeine Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2015-04-01 12:06:16 UTC (rev 20426) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2015-04-01 19:23:22 UTC (rev 20427) @@ -5201,7 +5201,7 @@ @Override public void setStringProperty(String key, String value) { - if (value == null) + if (value == null || key == null || key.length() == 0) return; if (key.charAt(0) == '_') { g.setO(key, value); @@ -5430,7 +5430,7 @@ @Override public void setFloatProperty(String key, float value) { - if (Float.isNaN(value)) + if (Float.isNaN(value) || key == null || key.length() == 0) return; if (key.charAt(0) == '_') { g.setF(key, value); @@ -5640,7 +5640,7 @@ @Override public void setIntProperty(String key, int value) { - if (value == Integer.MIN_VALUE) + if (value == Integer.MIN_VALUE || key == null || key.length() == 0) return; if (key.charAt(0) == '_') { g.setI(key, value); @@ -5848,6 +5848,8 @@ @Override public void setBooleanProperty(String key, boolean value) { + if (key == null || key.length() == 0) + return; if (key.charAt(0) == '_') { g.setB(key, value); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits