Revision: 21160
          http://sourceforge.net/p/jmol/code/21160
Author:   hansonr
Date:     2016-06-23 22:57:29 +0000 (Thu, 23 Jun 2016)
Log Message:
-----------
Jmol.___JmolVersion="14.6.0_2016.06.23"

bug fix: nn.? and nn.* are not processed properly as float nn.
         For example: print (35 == 35.? "yes" : "no") causes script exception
         

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

Modified: branches/v14_6/Jmol/src/org/jmol/script/ScriptCompiler.java
===================================================================
--- branches/v14_6/Jmol/src/org/jmol/script/ScriptCompiler.java 2016-06-23 
19:43:52 UTC (rev 21159)
+++ branches/v14_6/Jmol/src/org/jmol/script/ScriptCompiler.java 2016-06-23 
22:57:29 UTC (rev 21160)
@@ -2828,13 +2828,13 @@
 
     // to support 1.ca, let's check the character after the dot
     // to determine if it is an alpha
-    char ch1;
-    if (!eol(ch1 = charAt(ichT))) {
+    char ch1 = charAt(ichT);
+    if (!isSpaceOrTab(ch1) && !eol(ch1)) {
       if (PT.isLetter(ch1) || ch1 == '?' || ch1 == '*' || ch1 == '_')
         return false;
       //well, guess what? we also have to look for 86.1Na, so...
       //watch out for moveto..... 56.;refresh...
-      if (PT.isLetter(ch1 = charAt(ichT + 1)) || ch1 == '?')
+      if ((PT.isLetter(ch1 = charAt(ichT + 1)) || ch1 == '?'))
         return false;
     }
     while (PT.isDigit(charAt(ichT))) {

Modified: branches/v14_6/Jmol/src/org/jmol/script/ScriptExpr.java
===================================================================
--- branches/v14_6/Jmol/src/org/jmol/script/ScriptExpr.java     2016-06-23 
19:43:52 UTC (rev 21159)
+++ branches/v14_6/Jmol/src/org/jmol/script/ScriptExpr.java     2016-06-23 
22:57:29 UTC (rev 21160)
@@ -344,6 +344,14 @@
       case T.semicolon: // for (i = 1; i < 3; i=i+1)
         break out;
       case T.integer:
+        // checking here for nnn.? or nnn.*, which is not treated as "float" 
in the compiler
+        if (tokAt(iToken + 1) == T.per && ((tok = tokAt(iToken + 2)) == T.opIf 
|| tok == T.times)) {
+          theToken.value = Float.valueOf(theToken.intValue);
+          theToken.tok = T.decimal;
+          theToken.intValue = Integer.MAX_VALUE;
+          i++;
+        }
+        //$FALL-THROUGH$
       case T.decimal:
       case T.spec_seqcode:
         rpn.addXNum(theToken);

Modified: branches/v14_6/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- branches/v14_6/Jmol/src/org/jmol/viewer/Jmol.properties     2016-06-23 
19:43:52 UTC (rev 21159)
+++ branches/v14_6/Jmol/src/org/jmol/viewer/Jmol.properties     2016-06-23 
22:57:29 UTC (rev 21160)
@@ -7,8 +7,14 @@
 # see also http://chemapps.stolaf.edu/jmol/zip for daily updates       
 
 
-Jmol.___JmolVersion="14.6.0_2016.06.22"
+Jmol.___JmolVersion="14.6.0_2016.06.23"
 
+bug fix: nn.? and nn.* are not processed properly as float nn.
+         For example: print (35 == 35.? "yes" : "no") cause script exception
+         
+
+JmolVersion="14.6.0_2016.06.22"
+
 bug fix: compare(a,b,"isomer") does not detect ENANTIOMER (broken in 14.5.5)
 bug fix: missing error trap for unsettable property setting
 bug fix: load models {0 0 1} ... fails in script compiler

Modified: trunk/Jmol/src/org/jmol/script/ScriptCompiler.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptCompiler.java  2016-06-23 19:43:52 UTC 
(rev 21159)
+++ trunk/Jmol/src/org/jmol/script/ScriptCompiler.java  2016-06-23 22:57:29 UTC 
(rev 21160)
@@ -2828,8 +2828,8 @@
 
     // to support 1.ca, let's check the character after the dot
     // to determine if it is an alpha
-    char ch1;
-    if (!eol(ch1 = charAt(ichT))) {
+    char ch1 = charAt(ichT);
+    if (!isSpaceOrTab(ch1) && !eol(ch1)) {
       if (PT.isLetter(ch1) || ch1 == '?' || ch1 == '*' || ch1 == '_')
         return false;
       //well, guess what? we also have to look for 86.1Na, so...

Modified: trunk/Jmol/src/org/jmol/script/ScriptExpr.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptExpr.java      2016-06-23 19:43:52 UTC 
(rev 21159)
+++ trunk/Jmol/src/org/jmol/script/ScriptExpr.java      2016-06-23 22:57:29 UTC 
(rev 21160)
@@ -344,6 +344,14 @@
       case T.semicolon: // for (i = 1; i < 3; i=i+1)
         break out;
       case T.integer:
+        // checking here for nnn.? or nnn.*, which is not treated as "float" 
in the compiler
+        if (tokAt(iToken + 1) == T.per && ((tok = tokAt(iToken + 2)) == T.opIf 
|| tok == T.times)) {
+          theToken.value = Float.valueOf(theToken.intValue);
+          theToken.tok = T.decimal;
+          theToken.intValue = Integer.MAX_VALUE;
+          i++;
+        }
+        //$FALL-THROUGH$
       case T.decimal:
       case T.spec_seqcode:
         rpn.addXNum(theToken);

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2016-06-23 19:43:52 UTC 
(rev 21159)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2016-06-23 22:57:29 UTC 
(rev 21160)
@@ -47,8 +47,14 @@
  -- TODO not saved in state
  
 
-Jmol.___JmolVersion="14.7.0_2016.06.22"
+Jmol.___JmolVersion="14.7.0_2016.06.23"
 
+bug fix: nn.? and nn.* are not processed properly as float nn.
+         For example: print (35 == 35.? "yes" : "no") cause script exception
+         
+
+JmolVersion="14.7.0_2016.06.22"
+
 new feature: settable chain string using {atomset}.chain = "xxx"
 
 bug fix: compare(a,b,"isomer") does not detect ENANTIOMER (broken in 14.5.5)

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


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to