public override bool Equals(Variable other) { UnboundVariable otherVp = other as UnboundVariable; if (otherVp == null) { return(false); } return(otherVp.Idx == Idx); }
private UnboundVariable[] ParseSignature(Tokenizer tok) { var ret = new List <UnboundVariable>(); tok.Consume(TokenType.LParen); int idx = 0; while (tok.PeekToken().Type != TokenType.RParen) { string name = tok.Consume(TokenType.Id).Value; var variable = new UnboundVariable(idx, name); ret.Add(variable); idx++; } tok.Consume(TokenType.RParen); return(ret.ToArray()); }