Skip to content

Commit

Permalink
Made more sane.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Apr 4, 2001
1 parent d40ec90 commit b03141f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions last/toby/interpreter/VarReferenceIntrinsic.java
Expand Up @@ -30,7 +30,7 @@ public class VarReferenceIntrinsic extends Intrinsic
{
protected GlobalLogicContext globalContext = null;
protected LogicContext parentContext = null;
protected int varIndex = 0xFFFF;
protected int varIndex = 0xDEADBEEF;
protected boolean global = false;
protected int lineno = -1;

Expand All @@ -50,7 +50,8 @@ public boolean isConstantValue()

public String toString()
{
return(name + " [" + getRealVar().toString() + "]");
String str = null;
return(name + "==[" + getRealVar().toString() + "]");
} // toString

protected Intrinsic getCopyImpl()
Expand Down Expand Up @@ -199,6 +200,11 @@ public Object getObjectValue() throws FlowException
return(getRealVar().getObjectValue());
} // getValue overload

public Intrinsic getIntrinsicValue() throws FlowException
{
return(getRealVar().getIntrinsicValue());
} // getValue overload

public int compare(Intrinsic intr) throws FlowException
{
return(getRealVar().compare(intr));
Expand All @@ -211,14 +217,16 @@ public boolean isEqual(Intrinsic intr) throws FlowException

protected void linkImpl(GlobalLogicContext glob) throws ParseException
{
// _D("linkImpl", "looking for variable named [" + this.name + "].");
String id = getIdentifier();

// _D("linkImpl", "looking for variable named [" + id + "].");

this.globalContext = glob;
LogicContext rc = parentContext.checkScopesForSymbol(this.name);
LogicContext rc = parentContext.checkScopesForSymbol(id);
if (rc == null)
ParseException._throw(TobyLanguage.NOT_VAR, this.lineno);
this.global = (rc == glob);
this.varIndex = rc.getSymbolIndex(this.name);
this.varIndex = rc.getSymbolIndex(id);
} // link
} // VarReferenceIntrinsic

Expand Down

0 comments on commit b03141f

Please sign in to comment.