|
From: Christopher W. <caw...@us...> - 2006-05-17 02:41:12
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24172/src/org/rubypeople/rdt/internal/core Modified Files: RubyScriptProblemFinder.java Log Message: Add support for a Ruby "Lint" like AST visitor which will create semantic analysis and warnings ala JDT Index: RubyScriptProblemFinder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RubyScriptProblemFinder.java 10 Feb 2006 18:29:16 -0000 1.7 --- RubyScriptProblemFinder.java 17 May 2006 02:41:08 -0000 1.8 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IProgressMonitor; + import org.jruby.ast.Node; import org.jruby.lexer.yacc.SyntaxException; import org.rubypeople.rdt.core.IProblemRequestor; *************** *** 16,19 **** --- 17,21 ---- import org.rubypeople.rdt.internal.core.parser.Error; import org.rubypeople.rdt.internal.core.parser.RdtWarnings; + import org.rubypeople.rdt.internal.core.parser.RubyLintVisitor; import org.rubypeople.rdt.internal.core.parser.RubyParser; import org.rubypeople.rdt.internal.core.parser.TaskParser; *************** *** 32,36 **** String contents = new String(charContents); try { ! parser.parse((IFile) script.getUnderlyingResource(), new StringReader(contents)); } catch (SyntaxException e) { problemRequestor.acceptProblem(new Error(e.getPosition(), "Syntax Error")); --- 34,40 ---- String contents = new String(charContents); try { ! Node node = parser.parse((IFile) script.getUnderlyingResource(), new StringReader(contents)); ! RubyLintVisitor visitor = new RubyLintVisitor(problemRequestor); ! node.accept(visitor); } catch (SyntaxException e) { problemRequestor.acceptProblem(new Error(e.getPosition(), "Syntax Error")); |