|
From: <mir...@us...> - 2007-01-29 09:09:20
|
Revision: 1890
http://svn.sourceforge.net/rubyeclipse/?rev=1890&view=rev
Author: mirkostocker
Date: 2007-01-29 01:09:18 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
more patches for jruby, preparing for the refactorings import
Modified Paths:
--------------
trunk/org.jruby/lib/jruby.jar
trunk/org.jruby/src.zip
Added Paths:
-----------
trunk/org.jruby/patches/iterator_visitor.patch
trunk/org.jruby/patches/iternode_position.patch
trunk/org.jruby/patches/method_args.patch
trunk/org.jruby/patches/visit_rootnode.patch
Modified: trunk/org.jruby/lib/jruby.jar
===================================================================
(Binary files differ)
Added: trunk/org.jruby/patches/iterator_visitor.patch
===================================================================
--- trunk/org.jruby/patches/iterator_visitor.patch (rev 0)
+++ trunk/org.jruby/patches/iterator_visitor.patch 2007-01-29 09:09:18 UTC (rev 1890)
@@ -0,0 +1,69 @@
+Index: src/org/jruby/ast/visitor/DefaultIteratorVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/DefaultIteratorVisitor.java (revision 1146)
++++ src/org/jruby/ast/visitor/DefaultIteratorVisitor.java (working copy)
+@@ -195,14 +195,14 @@
+ return null;
+ }
+
+- /** @fixme iteration not correctly defined */
+ public Instruction visitAttrAssignNode(AttrAssignNode iVisited) {
+ iVisited.accept(_Payload);
+- // FIXME
+- /*
+- * for (Node node = iVisited.getArgsNode(); node != null; node =
+- * node.getNextNode()) { node.getHeadNode().accept(this); }
+- */
++ if(iVisited.getArgsNode() != null) {
++ iVisited.getArgsNode().accept(this);
++ }
++ if(iVisited.getReceiverNode() != null) {
++ iVisited.getReceiverNode().accept(this);
++ }
+ return null;
+ }
+
+@@ -272,16 +272,14 @@
+ return null;
+ }
+
+- /**
+- * @fixme iteration not correctly defined
+- */
+ public Instruction visitCallNode(CallNode iVisited) {
+ iVisited.getReceiverNode().accept(this);
+- // FIXME
+- /*
+- * for (Node node = iVisited.getArgsNode(); node != null; node =
+- * node.getNextNode()) { node.getHeadNode().accept(this); }
+- */
++ if(iVisited.getArgsNode() != null) {
++ iVisited.getArgsNode().accept(this);
++ }
++ if(iVisited.getIterNode() != null) {
++ iVisited.getIterNode().accept(this);
++ }
+ iVisited.accept(_Payload);
+ return null;
+ }
+@@ -387,14 +385,14 @@
+ return null;
+ }
+
+- /** @fixme iteration not correctly defined */
+ public Instruction visitFCallNode(FCallNode iVisited) {
+ iVisited.accept(_Payload);
+- // FIXME
+- /*
+- * for (Node node = iVisited.getArgsNode(); node != null; node =
+- * node.getNextNode()) { node.getHeadNode().accept(this); }
+- */
++ if(iVisited.getArgsNode() != null) {
++ iVisited.getArgsNode().accept(this);
++ }
++ if(iVisited.getIterNode() != null) {
++ iVisited.getIterNode().accept(this);
++ }
+ return null;
+ }
+
Added: trunk/org.jruby/patches/iternode_position.patch
===================================================================
--- trunk/org.jruby/patches/iternode_position.patch (rev 0)
+++ trunk/org.jruby/patches/iternode_position.patch 2007-01-29 09:09:18 UTC (rev 1890)
@@ -0,0 +1,127 @@
+Index: test/testPositions.rb
+===================================================================
+--- test/testPositions.rb (revision 1128)
++++ test/testPositions.rb (working copy)
+@@ -341,7 +341,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,0,6],
+- ['IterNode',0,0,4,6],
++ ['IterNode',0,0,0,6],
+ ['FCallNode',0,0,0,6]
+ ]
+ test_tree(list, <<'END', "operation brace_block [paren-less no-args block")
+@@ -351,7 +351,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,0,6],
+- ['IterNode',0,1,4,10],
++ ['IterNode',0,1,0,10],
+ ['FCallNode',0,1,0,10]
+ ]
+
+@@ -363,7 +363,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,6,9],
+- ['IterNode',0,0,6,8],
++ ['IterNode',0,0,0,8],
+ ['FCallNode',0,0,0,8],
+ ['ArrayNode',0,0,3,5]
+ ]
+@@ -375,7 +375,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,6,9],
+- ['IterNode',0,1,6,12],
++ ['IterNode',0,1,0,12],
+ ['FCallNode',0,1,0,12],
+ ['ArrayNode',0,0,3,5]
+ ]
+@@ -388,7 +388,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,2,6,17],
+- ['IterNode',0,1,6,16],
++ ['IterNode',0,1,0,16],
+ ['DAsgnNode',0,0,10,11],
+ ['FCallNode',0,1,0,16],
+ ['ArrayNode',0,0,3,5]
+@@ -402,7 +402,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,2,6,19],
+- ['IterNode',0,1,6,18],
++ ['IterNode',0,1,0,18],
+ ['MultipleAsgnNode',0,0,9,14],
+ ['ArrayNode',0,0,10,13],
+ ['DAsgnNode',0,0,10,11],
+@@ -419,7 +419,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,2,10,23],
+- ['IterNode',0,1,10,22],
++ ['IterNode',0,1,0,22],
+ ['MultipleAsgnNode',0,0,13,18],
+ ['ArrayNode',0,0,14,17],
+ ['DAsgnNode',0,0,14,15],
+@@ -1282,7 +1282,7 @@
+ list = [
+ nil,
+ nil,
+-['IterNode', 0, 2, 15, 34],
++['IterNode', 0, 2, 0, 34],
+ ['DAsgnNode', 0, 0, 19, 20],
+ nil,
+ ['FCallNode', 1, 1, 24, 30],
+@@ -1460,7 +1460,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode', 0, 1, 0, 25],
+-['IterNode', 0, 0, 8, 24],
++['IterNode', 0, 0, 0, 24],
+ nil, #['NewlineNode', 0, 0, 10, 24],
+ ['FCallNode', 0, 0, 10, 22],
+ ['ArrayNode', 0, 0, 15, 22],
+Index: src/org/jruby/parser/DefaultRubyParser.java
+===================================================================
+--- src/org/jruby/parser/DefaultRubyParser.java (revision 1128)
++++ src/org/jruby/parser/DefaultRubyParser.java (working copy)
+@@ -2583,7 +2583,7 @@
+ case 351:
+ // line 1269 "DefaultRubyParser.y"
+ {
+- yyVal = new IterNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
++ yyVal = new IterNode(support.union(((ISourcePositionHolder)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
+ support.popCurrentScope();
+ }
+ break;
+@@ -2596,7 +2596,7 @@
+ case 353:
+ // line 1275 "DefaultRubyParser.y"
+ {
+- yyVal = new IterNode(support.union(((Token)yyVals[-4+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
++ yyVal = new IterNode(support.union(((ISourcePositionHolder)yyVals[-5+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
+ support.popCurrentScope();
+ }
+ break;
+Index: src/org/jruby/parser/DefaultRubyParser.y
+===================================================================
+--- src/org/jruby/parser/DefaultRubyParser.y (revision 1128)
++++ src/org/jruby/parser/DefaultRubyParser.y (working copy)
+@@ -1267,13 +1267,13 @@
+ brace_block : tLCURLY {
+ support.pushBlockScope();
+ } opt_block_var compstmt tRCURLY {
+- $$ = new IterNode(support.union($1, $5), $3, support.getCurrentScope(), $4, null);
++ $$ = new IterNode(support.union($<ISourcePositionHolder>0, $5), $3, support.getCurrentScope(), $4, null);
+ support.popCurrentScope();
+ }
+ | kDO {
+ support.pushBlockScope();
+ } opt_block_var compstmt kEND {
+- $$ = new IterNode(support.union($1, $5), $3, support.getCurrentScope(), $4, null);
++ $$ = new IterNode(support.union($<ISourcePositionHolder>0, $5), $3, support.getCurrentScope(), $4, null);
+ support.popCurrentScope();
+ }
+
Added: trunk/org.jruby/patches/method_args.patch
===================================================================
--- trunk/org.jruby/patches/method_args.patch (rev 0)
+++ trunk/org.jruby/patches/method_args.patch 2007-01-29 09:09:18 UTC (rev 1890)
@@ -0,0 +1,42 @@
+Index: src/org/jruby/parser/ParserSupport.java
+===================================================================
+--- src/org/jruby/parser/ParserSupport.java (revision 1135)
++++ src/org/jruby/parser/ParserSupport.java (working copy)
+@@ -238,7 +238,7 @@
+ } else {
+ switch (IdUtil.getVarType(id)) {
+ case IdUtil.LOCAL_VAR:
+- return currentScope.assign(lhs.getPosition(), id, value);
++ return currentScope.assign(value != null ? union(lhs, value) : lhs.getPosition(), id, value);
+ case IdUtil.CONSTANT:
+ if (isInDef() || isInSingle()) {
+ throw new SyntaxException(lhs.getPosition(), "dynamic constant assignment");
+Index: src/org/jruby/ast/BlockArgNode.java
+===================================================================
+--- src/org/jruby/ast/BlockArgNode.java (revision 1135)
++++ src/org/jruby/ast/BlockArgNode.java (working copy)
+@@ -83,7 +83,12 @@
+ return name;
+ }
+
++ public void setName(String name) {
++ this.name = name;
++ }
++
+ public List childNodes() {
+ return EMPTY_LIST;
+ }
++
+ }
+Index: src/org/jruby/ast/visitor/rewriter/ReWriteVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/rewriter/ReWriteVisitor.java (revision 1135)
++++ src/org/jruby/ast/visitor/rewriter/ReWriteVisitor.java (working copy)
+@@ -1681,6 +1681,7 @@
+ }
+
+ public Instruction visitRootNode(RootNode iVisited) {
++ config.getLocalVariables().addLocalVariable(iVisited.getStaticScope());
+ visitNode(iVisited.getBodyNode());
+ if(config.hasHereDocument()) {
+ config.fetchHereDocument().print();
Added: trunk/org.jruby/patches/visit_rootnode.patch
===================================================================
--- trunk/org.jruby/patches/visit_rootnode.patch (rev 0)
+++ trunk/org.jruby/patches/visit_rootnode.patch 2007-01-29 09:09:18 UTC (rev 1890)
@@ -0,0 +1,61 @@
+Index: src/org/jruby/ast/visitor/AbstractVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/AbstractVisitor.java (revision 1135)
++++ src/org/jruby/ast/visitor/AbstractVisitor.java (working copy)
+@@ -34,7 +34,9 @@
+ import org.jruby.ast.AndNode;
+ import org.jruby.ast.ArgsCatNode;
+ import org.jruby.ast.ArgsNode;
++import org.jruby.ast.ArgsPushNode;
+ import org.jruby.ast.ArrayNode;
++import org.jruby.ast.AttrAssignNode;
+ import org.jruby.ast.BackRefNode;
+ import org.jruby.ast.BeginNode;
+ import org.jruby.ast.BignumNode;
+@@ -130,7 +132,7 @@
+ * @author jpetersen
+ */
+ public abstract class AbstractVisitor implements NodeVisitor {
+-
++
+ /**
+ * This method is called by default for each visited Node.
+ */
+@@ -515,4 +517,12 @@
+ public Instruction visitSymbolNode(SymbolNode iVisited) {
+ return visitNode(iVisited);
+ }
++
++ public Instruction visitArgsPushNode(ArgsPushNode iVisited) {
++ return visitNode(iVisited);
++ }
++
++ public Instruction visitAttrAssignNode(AttrAssignNode iVisited) {
++ return visitNode(iVisited);
++ }
+ }
+Index: src/org/jruby/ast/visitor/NodeVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/NodeVisitor.java (revision 1135)
++++ src/org/jruby/ast/visitor/NodeVisitor.java (working copy)
+@@ -140,7 +140,7 @@
+ public Instruction visitAndNode(AndNode iVisited);
+ public Instruction visitArgsNode(ArgsNode iVisited);
+ public Instruction visitArgsCatNode(ArgsCatNode iVisited);
+- public Instruction visitArgsPushNode(ArgsPushNode node);
++ public Instruction visitArgsPushNode(ArgsPushNode iVisited);
+ public Instruction visitArrayNode(ArrayNode iVisited);
+ public Instruction visitAttrAssignNode(AttrAssignNode iVisited);
+ public Instruction visitBackRefNode(BackRefNode iVisited);
+Index: src/org/jruby/ast/visitor/DefaultIteratorVisitor.java
+===================================================================
+--- src/org/jruby/ast/visitor/DefaultIteratorVisitor.java (revision 1135)
++++ src/org/jruby/ast/visitor/DefaultIteratorVisitor.java (working copy)
+@@ -589,6 +589,7 @@
+
+ public Instruction visitRootNode(RootNode iVisited) {
+ iVisited.accept(_Payload);
++ iVisited.getBodyNode().accept(this);
+ return null;
+ }
+
Modified: trunk/org.jruby/src.zip
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|