|
From: <caw...@us...> - 2007-03-26 15:40:54
|
Revision: 2228
http://svn.sourceforge.net/rubyeclipse/?rev=2228&view=rev
Author: cawilliams
Date: 2007-03-26 07:17:18 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
remove a fairly useless lint visitor (which was more of an example one really)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java 2007-03-26 14:09:51 UTC (rev 2227)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java 2007-03-26 14:17:18 UTC (rev 2228)
@@ -1,7 +1,6 @@
package org.rubypeople.rdt.internal.core.parser.warnings;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import org.jruby.ast.AliasNode;
@@ -99,7 +98,6 @@
import org.jruby.ast.ZArrayNode;
import org.jruby.ast.ZSuperNode;
import org.jruby.evaluator.Instruction;
-import org.rubypeople.rdt.core.IProblemRequestor;
import org.rubypeople.rdt.core.compiler.CategorizedProblem;
import org.rubypeople.rdt.internal.core.parser.InOrderVisitor;
@@ -124,7 +122,6 @@
// FIXME Run through a map of keys to classes and add instances of
// classes whose key is not set to ignore
visitors.add(new EmptyStatementVisitor(contents));
- visitors.add(new StaticConditionalVisitor(contents));
visitors.add(new ConstantReassignmentVisitor(contents));
return visitors;
}
Deleted: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java 2007-03-26 14:09:51 UTC (rev 2227)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java 2007-03-26 14:17:18 UTC (rev 2228)
@@ -1,32 +0,0 @@
-package org.rubypeople.rdt.internal.core.parser.warnings;
-
-import org.jruby.ast.FalseNode;
-import org.jruby.ast.IfNode;
-import org.jruby.ast.NilNode;
-import org.jruby.ast.Node;
-import org.jruby.ast.TrueNode;
-import org.jruby.evaluator.Instruction;
-
-public class StaticConditionalVisitor extends RubyLintVisitor {
-
- public StaticConditionalVisitor(String contents) {
- super(contents);
- }
-
- @Override
- protected String getOptionKey() {
-// FIXME Set up a compiler option for this!
- return null;
- }
-
- public Instruction visitIfNode(IfNode iVisited) {
- Node condition = iVisited.getCondition();
- if (condition instanceof TrueNode) {
- createProblem(iVisited.getPosition(), "Condition is always true");
- } else if ((condition instanceof FalseNode) || (condition instanceof NilNode)) {
- createProblem(iVisited.getPosition(), "Condition is always false");
- }
- return super.visitIfNode(iVisited);
- }
-
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|