コード例 #1
0
 public void WriteControlStructure(ControlStructureBlock block)
 {
     WriteIndent();
     WriteLine(block.Keyword.Text);
     StartBlock();
     VisitContainer(block.VMembers);
     EndBlock();
 }
コード例 #2
0
        /// <summary>
        /// Tries to UnIndent the current line -
        /// if this line is inside some ControlStructureBlock,
        /// move this line out and after its parent.
        /// </summary>
        /// <returns>Parent control structure if UnIndent is possible, null otherwise.</returns>
        protected virtual Block CanUnIndent()
        {
            ControlStructureBlock par = ParentParent as ControlStructureBlock;

            if (par == null || this.Prev == null || this.Next != null)
            {
                return(null);
            }
            return(par);
        }
コード例 #3
0
 public void WriteControlStructureWithString(ControlStructureBlock block, string title)
 {
     WriteIndent();
     Write(block.Keyword.Text);
     Write("(");
     Write(title);
     WriteLine(")");
     StartBlock();
     VisitContainer(block.VMembers);
     EndBlock();
 }
コード例 #4
0
        /// <summary>
        /// Tries to "indent" the current line - which is,
        /// if a previous block is a ControlStructureBlock, it tries to
        /// append this line to the end of the previous block, thus "raising" it.
        /// </summary>
        /// <returns>A block after which the current block must be placed,
        /// to be indented. null if no such block exists.</returns>
        protected Block CanIndent()
        {
            ControlStructureBlock prev = this.Prev as ControlStructureBlock;

            if (prev == null)
            {
                return(null);
            }

            return(prev.VMembers.Children.Tail);
        }
コード例 #5
0
ファイル: PrettyPrinter.cs プロジェクト: Ju2ender/csharp-e
 public void WriteControlStructureWithString(ControlStructureBlock block, string title)
 {
     WriteIndent();
     Write(block.Keyword.Text);
     Write("(");
     Write(title);
     WriteLine(")");
     StartBlock();
     VisitContainer(block.VMembers);
     EndBlock();
 }
コード例 #6
0
ファイル: PrettyPrinter.cs プロジェクト: Ju2ender/csharp-e
 public void WriteControlStructure(ControlStructureBlock block)
 {
     WriteIndent();
     WriteLine(block.Keyword.Text);
     StartBlock();
     VisitContainer(block.VMembers);
     EndBlock();
 }