From: <ha...@us...> - 2007-02-12 17:46:09
|
Revision: 6794 http://svn.sourceforge.net/jmol/?rev=6794&view=rev Author: hansonr Date: 2007-02-12 09:46:01 -0800 (Mon, 12 Feb 2007) Log Message: ----------- 11.1.12 proper IF nesting across script files Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Eval.java Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2007-02-12 16:54:29 UTC (rev 6793) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2007-02-12 17:46:01 UTC (rev 6794) @@ -49,11 +49,14 @@ int pcEnd = Integer.MAX_VALUE; int lineEnd = Integer.MAX_VALUE; int iToken; + boolean ifs[]; } class Eval { //implements Runnable { + final static int scriptLevelMax = 10; + final static int MAX_IF_DEPTH = 10; //should be plenty + Compiler compiler; - final static int scriptLevelMax = 10; int scriptLevel; Context[] stack = new Context[scriptLevelMax]; String filename; @@ -74,7 +77,7 @@ Viewer viewer; BitSet bsSubset; int iToken; - + boolean[] ifs; boolean isSyntaxCheck, isScriptCheck; //Thread myThread; @@ -187,6 +190,7 @@ context.lineEnd = lineEnd; context.pcEnd = pcEnd; context.iToken = iToken; + context.ifs = ifs; stack[scriptLevel++] = context; if (isScriptCheck) Logger.info("-->>-------------".substring(0, scriptLevel + 5) + filename); @@ -206,10 +210,11 @@ aatoken = context.aatoken; statement = context.statement; statementLength = context.statementLength; - iToken = context.iToken; pc = context.pc; lineEnd = context.lineEnd; pcEnd = context.pcEnd; + iToken = context.iToken; + ifs = context.ifs; } boolean loadScript(String filename, String script) { @@ -516,12 +521,10 @@ int commandHistoryLevelMax = 0; - final static int MAX_IF_DEPTH = 10; //should be plenty - boolean[] ifs = new boolean[MAX_IF_DEPTH + 1]; - void instructionDispatchLoop(boolean doList) throws ScriptException { long timeBegin = 0; int ifLevel = 0; + ifs = new boolean[MAX_IF_DEPTH + 1]; ifs[0] = true; debugScript = (!isSyntaxCheck && viewer.getDebugScript()); logMessages = (debugScript && Logger.isActiveLevel(Logger.LEVEL_DEBUG)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |