Example #1
0
 public override void OnVisitMatch(ParseNode node)
 {
     var cleanStates = new CleanupAstNodeStates(node.Parent.Children);
     var advance = cleanStates.MappedNodes.IndexOf(node);
     if (advance == 0)
         return;
     cleanStates.ShiftBlock(advance);
 }
Example #2
0
 static void FoldBlocks(CleanupAstNodeStates cleanStates)
 {
     for (var pos = 0; pos < cleanStates.Count; pos++)
     {
         var currentNode = cleanStates[pos];
         var tokenKind = currentNode.GetTokenKind();
         switch (tokenKind)
         {
             case TokenKind.OpenCurly:
                 cleanStates.ShiftBlock(pos);
                 break;
         }
     }
 }