示例#1
0
        public override void VisitBlockStmt(BlockStmt x)
        {
            Add(_binder.BindEmptyStmt(new Span(x.Span.Start, 1)));   // {

            base.VisitBlockStmt(x);                                  // visit nested statements

            Add(_binder.BindEmptyStmt(new Span(x.Span.End - 1, 1))); // } // TODO: endif; etc.
        }
示例#2
0
        public override void VisitBlockStmt(BlockStmt x)
        {
            Add(_binder.BindEmptyStmt(new Span(x.Span.Start, 1))); // {

            base.VisitBlockStmt(x);                                // visit nested statements

            var closingspan = x.ClosingToken switch
            {
                Tokens.T_ENDIF => new Span(x.Span.End, "endif".Length), // endif
                Tokens.T_ELSEIF => Span.Invalid,                        // elseif
                Tokens.T_ELSE => Span.Invalid,                          // else
                _ => new Span(x.Span.End - 1, 1),                       // }
            };

            if (closingspan.IsValid)
            {
                Add(_binder.BindEmptyStmt(closingspan));
            }
        }