AjErl.Compiler.Parser.ParseReceiveExpression C# (CSharp) Method

ParseReceiveExpression() private method

private ParseReceiveExpression ( ) : IExpression
return IExpression
        private IExpression ParseReceiveExpression()
        {
            IList<MatchBody> matches = new List<MatchBody>();

            while (true)
            {
                var expr = this.ParseSimpleExpression();

                // TODO review head evaluation
                var head = expr.Evaluate(new Context(), true);
                this.ParseToken(TokenType.Operator, "->");
                var body = this.ParseCompositeExpression();
                matches.Add(new MatchBody(head, body));

                if (!this.TryParseToken(TokenType.Separator, ";"))
                    break;
            }

            this.ParseToken(TokenType.Atom, "end");

            return new ReceiveExpression(matches);
        }