From: Samuele P. <ped...@us...> - 2001-03-10 02:12:00
|
Update of /cvsroot/jython/jython/org/python/compiler In directory usw-pr-cvs1:/tmp/cvs-serv18403 Modified Files: CodeCompiler.java Future.java ScopesCompiler.java Removed Files: LocalsCompiler.java Log Message: fixed typo (in ScopesCompiler.java). fixed error msg passing node to ctr so correct line is reported (in Future.java). fixed long standing and fresh (of mine) spurious emitted getname instead of the correct getglobal (in CodeCompiler.java). Index: CodeCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/CodeCompiler.java,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** CodeCompiler.java 2001/03/08 23:43:51 2.12 --- CodeCompiler.java 2001/03/10 02:13:48 2.13 *************** *** 2267,2282 **** loadFrame(); if (syminf != null) { ! if (fast_locals) { ! if ((syminf.flags&ScopeInfo.GLOBAL) !=0 && optimizeGlobals) { ! code.ldc(name); ! if (mrefs.getglobal == 0) { ! mrefs.getglobal = code.pool.Methodref( ! "org/python/core/PyFrame", "getglobal", ! "(Ljava/lang/String;)Lorg/python/core/PyObject;"); ! } ! code.invokevirtual(mrefs.getglobal); ! return null; } ! if ((syminf.flags&ScopeInfo.GLOBAL)==0 && (syminf.flags&ScopeInfo.CELL)!=0) { code.iconst(syminf.env_index); if (mrefs.getderef == 0) { --- 2267,2285 ---- loadFrame(); if (syminf != null) { ! int flags = syminf.flags; ! if (!my_scope.nested_scopes) flags &= ~ScopeInfo.FREE; ! if ((flags&ScopeInfo.GLOBAL) !=0 || ! optimizeGlobals&&fast_locals&&(flags&(ScopeInfo.BOUND|ScopeInfo.CELL|ScopeInfo.FREE))==0) { ! code.ldc(name); ! if (mrefs.getglobal == 0) { ! mrefs.getglobal = code.pool.Methodref( ! "org/python/core/PyFrame", "getglobal", ! "(Ljava/lang/String;)Lorg/python/core/PyObject;"); } ! code.invokevirtual(mrefs.getglobal); ! return null; ! } ! if (fast_locals) { ! if ((flags&ScopeInfo.CELL) != 0) { code.iconst(syminf.env_index); if (mrefs.getderef == 0) { *************** *** 2288,2292 **** return null; } ! if ((syminf.flags&ScopeInfo.GLOBAL)==0 && (syminf.flags&ScopeInfo.BOUND)!=0) { code.iconst(syminf.locals_index); if (mrefs.getlocal2 == 0) { --- 2291,2295 ---- return null; } ! if ((flags&ScopeInfo.BOUND) != 0) { code.iconst(syminf.locals_index); if (mrefs.getlocal2 == 0) { *************** *** 2299,2303 **** } } ! if (my_scope.nested_scopes && (syminf.flags&ScopeInfo.FREE) != 0) { code.iconst(syminf.env_index); if (mrefs.getderef == 0) { --- 2302,2306 ---- } } ! if ((flags&ScopeInfo.FREE) != 0) { code.iconst(syminf.env_index); if (mrefs.getderef == 0) { Index: Future.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Future.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -r2.1 -r2.2 *** Future.java 2001/03/08 23:43:51 2.1 --- Future.java 2001/03/10 02:13:48 2.2 *************** *** 36,40 **** continue; } ! throw new ParseException("future feature "+feature+" is not defined"); } return true; --- 36,40 ---- continue; } ! throw new ParseException("future feature "+feature+" is not defined",cand); } return true; *************** *** 45,48 **** --- 45,49 ---- nested_scopes = cflags.nested_scopes; } + if ( node.id != PythonGrammarTreeConstants.JJTFILE_INPUT && node.id != PythonGrammarTreeConstants.JJTSINGLE_INPUT) return; Index: ScopesCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ScopesCompiler.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -r2.1 -r2.2 *** ScopesCompiler.java 2001/03/08 23:43:51 2.1 --- ScopesCompiler.java 2001/03/10 02:13:48 2.2 *************** *** 237,241 **** if ((prev&GLOBAL) != 0) continue; String what; ! if ((prev&BOUND) != 0) what = "assignement"; else what = "use"; code_compiler.error("name '"+name+"' declared global after "+what,false,node); } --- 237,241 ---- if ((prev&GLOBAL) != 0) continue; String what; ! if ((prev&BOUND) != 0) what = "assignment"; else what = "use"; code_compiler.error("name '"+name+"' declared global after "+what,false,node); } --- LocalsCompiler.java DELETED --- |