Ejemplo n.º 1
0
 internal override Value Eval(DelimiterNode prev, DelimiterNode next, IScope paramScope, IScope bodyScope, INodeRequestor nodes, ILineRequestor requestor)
 {
     if (next == null)
         return this;	// without parameters, it's still a function
     Value post = EvalNode.Do(next, paramScope, nodes, requestor);
     Value match, leftover;
     if (!PatternChecker.Do(post, Metadata[keyNextPattern], false/*bShortPat*/, out match, out leftover))
         throw new Loki3Exception().AddWrongPattern(Metadata[keyNextPattern], post);
     if (leftover != null)
         // create a partial function that starts w/ match & still needs leftover
         return new PartialFunctionPre(this, match, leftover);
     Value retval = Eval(match, bodyScope);
     bodyScope.Exit();
     return retval;
 }