|
From: <caw...@us...> - 2007-05-23 16:00:44
|
Revision: 2524
http://svn.sourceforge.net/rubyeclipse/?rev=2524&view=rev
Author: cawilliams
Date: 2007-05-23 09:00:24 -0700 (Wed, 23 May 2007)
Log Message:
-----------
make RubyField abstract, force creation of subclasses
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyField.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyField.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyField.java 2007-05-23 03:02:18 UTC (rev 2523)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyField.java 2007-05-23 16:00:24 UTC (rev 2524)
@@ -32,7 +32,7 @@
* @author Chris
*
*/
-public class RubyField extends NamedMember implements IField {
+public abstract class RubyField extends NamedMember implements IField {
// FIXME Combine the Variables into a single class?
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java 2007-05-23 03:02:18 UTC (rev 2523)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java 2007-05-23 16:00:24 UTC (rev 2524)
@@ -85,7 +85,16 @@
* @see IType#getField
*/
public IField getField(String fieldName) {
- return new RubyField(this, fieldName);
+ if (fieldName.startsWith("@@"))
+ return new RubyClassVar(this, fieldName);
+ if (fieldName.startsWith("@"))
+ return new RubyInstVar(this, fieldName);
+ if (fieldName.startsWith("$"))
+ return new RubyGlobal(this, fieldName);
+ if (Character.isUpperCase(fieldName.charAt(0)))
+ return new RubyConstant(this, fieldName);
+ Assert.isTrue(false, "Tried to access a field which isn't an instance variable, class variable, global or constant");
+ return null;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|