Revision: 1536 Author: jasonpmorrison Date: 2006-07-20 15:34:35 -0700 (Thu, 20 Jul 2006) ViewCVS: http://svn.sourceforge.net/rubyeclipse/?rev=1536&view=rev Log Message: ----------- Initial support for mark occurrence on dynamic var refs (block args etc.) Modified Paths: -------------- branches/type_inferrence/trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/ti/MarkOccurrencesTest.java Modified: branches/type_inferrence/trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/ti/MarkOccurrencesTest.java =================================================================== --- branches/type_inferrence/trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/ti/MarkOccurrencesTest.java 2006-07-20 22:34:27 UTC (rev 1535) +++ branches/type_inferrence/trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/ti/MarkOccurrencesTest.java 2006-07-20 22:34:35 UTC (rev 1536) @@ -2,6 +2,7 @@ import java.util.List; +import org.jruby.ast.BlockArgNode; import org.jruby.ast.Node; import org.jruby.lexer.yacc.ISourcePosition; import org.rubypeople.rdt.internal.core.parser.RubyParser; @@ -165,11 +166,12 @@ assertOccurrencesEqual( source, 34, "Klass", offsets ); } -// public void testBlockArguments() { -// String source = "[1,2,3].each { |number| puts number }"; -// int[][] offsets = {{16,22},{29,35}}; -// assertOccurrencesEqual(source, 16, "number", offsets); -// } + public void testBlockArguments() { + String source = "[1,2,3].each { |number| puts number }"; + int[][] offsets = {{16,22},{29,35}}; + assertOccurrencesEqual(source, 16, "number", offsets); +// assertOccurrencesEqual(source, 29, "number", offsets); + } /** @@ -189,4 +191,16 @@ int[][] offsets = {{20,29},{60,69}}; assertOccurrencesEqual( source, 23, "@@cls_var", offsets ); } + +// Oddity with local/dvars: +// +// foo = Printer.new +// [person, place, thing].each do |noun| +// foo.print(noun) +// end +// noun = "hi" +// +// There are 3 refs to "noun". Clicking the first highlights 1&2, clicking 2 highlights 1&2 +// but clicking 3 highlights 2&3 - ????! + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |