Revision: 20412 http://sourceforge.net/p/jmol/code/20412 Author: hansonr Date: 2015-03-31 02:22:21 +0000 (Tue, 31 Mar 2015) Log Message: -----------
Modified Paths: -------------- branches/v14_2/Jmol/src/org/jmol/script/ScriptCompiler.java branches/v14_2/Jmol/src/org/jmol/script/ScriptExpr.java branches/v14_2/Jmol/src/org/jmol/scriptext/MathExt.java branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties Modified: branches/v14_2/Jmol/src/org/jmol/script/ScriptCompiler.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/script/ScriptCompiler.java 2015-03-31 02:22:06 UTC (rev 20411) +++ branches/v14_2/Jmol/src/org/jmol/script/ScriptCompiler.java 2015-03-31 02:22:21 UTC (rev 20412) @@ -908,12 +908,13 @@ ident = script.substring(ichToken, ichToken + cchToken); identLC = ident.toLowerCase(); boolean isUserVar = (isContextVariable(identLC)); + String preserveCase = null; if (nTokens == 0) isUserToken = isUserVar; if (nTokens == 1 && (tokCommand == T.function || tokCommand == T.parallel || tokCommand == T.var) - || nTokens != 0 && isUserVar && lastToken.tok != T.per - || isUserFunction(identLC) + || nTokens != 0 && isUserVar && lastToken.tok != T.per || !isDotDot + && isUserFunction(identLC) && ((preserveCase = ident) != null) && (thisFunction == null || !thisFunction.name.equals(identLC))) { // we need to allow: @@ -926,7 +927,7 @@ // color += ... // color[ ... - ident = identLC; + ident = (preserveCase == null ? identLC : preserveCase); theToken = null; } else if (ident.length() == 1 || lastToken.tok == T.colon) { // hack to support case sensitive alternate locations and chains @@ -945,10 +946,11 @@ } if (theToken == null) { - if (identLC.indexOf("property_") == 0) + if (identLC.indexOf("property_") == 0) { theToken = T.o(T.property, identLC); - else + } else { theToken = T.o(T.identifier, ident); + } } theTok = theToken.tok; } Modified: branches/v14_2/Jmol/src/org/jmol/script/ScriptExpr.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/script/ScriptExpr.java 2015-03-31 02:22:06 UTC (rev 20411) +++ branches/v14_2/Jmol/src/org/jmol/script/ScriptExpr.java 2015-03-31 02:22:21 UTC (rev 20412) @@ -185,7 +185,7 @@ if (isImplicitAtomProperty && tokAt(i + 1) != T.per) { // local variable definition SV token = (localVars != null && localVars.containsKey(theToken.value) ? null - : getBitsetPropertySelector(i, false, false)); + : getBitsetPropertySelector(i)); if (token != null) { rpn.addX(localVars.get(localVar)); if (!rpn.addOpAllowMath(token, (tokAt(i + 1) == T.leftparen))) @@ -475,7 +475,7 @@ continue; } } - SV var = getBitsetPropertySelector(i + 1, false, false); + SV var = getBitsetPropertySelector(i + 1); if (var == null) invArg(); // check for added min/max modifier @@ -1459,9 +1459,7 @@ return bs; } - private SV getBitsetPropertySelector(int i, boolean mustBeSettable, - boolean isExpression) - throws ScriptException { + private SV getBitsetPropertySelector(int i) throws ScriptException { int tok = getToken(i).tok; switch (tok) { case T.min: @@ -1478,17 +1476,11 @@ if (tok != T.opIf && !T.tokAttr(tok, T.identifier)) return null; String name = paramAsStr(i); - if (!mustBeSettable && vwr.isFunction(name)) { + if (vwr.isFunction(name.toLowerCase())) { tok = T.function; break; } - if (isExpression && !name.endsWith("?")) - return null; - if (isExpression) - tok = T.identifier; } - if (mustBeSettable && isExpression && !T.tokAttr(tok, T.settable)) - return null; return SV.newSV(T.propselector, tok, paramAsStr(i)); } Modified: branches/v14_2/Jmol/src/org/jmol/scriptext/MathExt.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/scriptext/MathExt.java 2015-03-31 02:22:06 UTC (rev 20411) +++ branches/v14_2/Jmol/src/org/jmol/scriptext/MathExt.java 2015-03-31 02:22:21 UTC (rev 20412) @@ -2464,9 +2464,20 @@ SV x1 = null; if (isSelector) { x1 = mp.getX(); - if (x1.tok != T.bitset) + switch (x1.tok) { + case T.bitset: + break; + case T.hash: + // really xx.yyy where yyy is a function; + if (args.length > 0) + return false; + x1 = x1.getMap().get(name); + return (x1 == null ? mp.addXStr("") : mp.addX(x1)); + default: return false; + } } + name = name.toLowerCase(); mp.wasX = false; Lst<SV> params = new Lst<SV>(); for (int i = 0; i < args.length; i++) { Modified: branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties 2015-03-31 02:22:06 UTC (rev 20411) +++ branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties 2015-03-31 02:22:21 UTC (rev 20412) @@ -4,8 +4,13 @@ # THIS IS THE RELEASE BRANCH # BUG FIXES ONLY, PLEASE -Jmol.___JmolVersion="14.2.13_2015.03.23" +Jmol.___JmolVersion="14.2.13_2015.03.30" +bug fix: {hash}.Key = value will be stored as "key" rather than "Key". +bug fix: {hash}.key will fail if "key" is also a user-defined function. + +JmolVersion="14.2.13_2015.03.23" + bug fix: isosurface solvent will fail if max volume is smaller than cavity max even though not cavity JmolVersion="14.2.13_2015.03.20b" 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