mirror of https://github.com/tbklang/tlang.git
Mcro
- Made `Repr` implement `MStatementSearchable` - Added new interface `MCloneable` to represent PNode's which are deeply-cloneable
This commit is contained in:
parent
7bd31ae770
commit
82a71c4b20
|
@ -49,11 +49,39 @@ public interface MStatementReplaceable
|
|||
public void replace(Statement thiz, Statement that);
|
||||
}
|
||||
|
||||
public class Repr : Expression
|
||||
/**
|
||||
* Anything which implements this can make a full
|
||||
* deep clone of itself
|
||||
*/
|
||||
public interface MCloneable
|
||||
{
|
||||
/**
|
||||
* Returns a `Statement` which is a clone of this one
|
||||
* itself
|
||||
*
|
||||
* Returns: the cloned `Statement`
|
||||
*/
|
||||
public Statement clone();
|
||||
}
|
||||
|
||||
public class Repr : Expression, MStatementSearchable
|
||||
{
|
||||
/**
|
||||
* TODO: Add a MStatementSearchable implementation
|
||||
*/
|
||||
public override Statement[] search(TypeInfo_Class clazzType)
|
||||
{
|
||||
/* List of returned matches */
|
||||
Statement[] matches;
|
||||
|
||||
/* Are we (ourselves) of this type? */
|
||||
if(clazzType.isBaseOf(this.classinfo))
|
||||
{
|
||||
matches ~= [this];
|
||||
}
|
||||
|
||||
return matches;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue