Exemplo n.º 1
0
        public override bool Equals(Variable other)
        {
            UnboundVariable otherVp = other as UnboundVariable;

            if (otherVp == null)
            {
                return(false);
            }
            return(otherVp.Idx == Idx);
        }
Exemplo n.º 2
0
        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());
        }