Example #1
0
        private Node ParseBlock()
        {
            var node = new Node.Block();

            node.AddSpan(this.Expect(TokenKind.BraceOpen).span);
            this.insideCondition.Push(false);
            node.exprs = this.ParseList(TokenKind.Semicolon, TokenKind.BraceClose, this.ParseExpr);
            this.insideCondition.Pop();
            node.AddSpan(this.Previous.span);
            return(node);
        }
Example #2
0
            public static Node.Block Parse()
            {
                Node.Block n;

                Match(Tokens.Operator, Lexemes.BraceOpen);

                n = new Node.Block
                {
                    S     = Parser.Sequence.Parse(),
                    Label = null
                };

                Match(Tokens.Operator, Lexemes.BraceClose);

                return(n);
            }
Example #3
0
 private Types.Object EvaluateBlock(Node.Block node)
 {
     return(Evaluate(node.S).Itself);
 }