コード例 #1
0
 public override IEnumerable <string> VisitSequence(ISequence sequenceParam, PsiFmtStageContext context)
 {
     /*var node = context.RightChild;
      * var child = sequenceParam.FirstChild;
      * int length = 0;
      * while(child != node)
      * {
      * if(! ( child is IWhitespaceNode))
      * {
      *  if(length > MaxLineLength)
      *  {
      *    length = 0;
      *  }
      *  length += child.GetTextLength();
      * }
      * child = child.NextSibling;
      * }
      * if (length < MaxLineLength)
      * {
      * return new string[] { " " };
      * }
      * else
      * {*/
     return(new[] { "\r\n" });
     //}
 }
コード例 #2
0
        public override IEnumerable <string> VisitPsiFile(IPsiFile psiFile, PsiFmtStageContext context)
        {
            if (!myIsGenerated)
            {
                return(base.VisitPsiFile(psiFile, context));
            }

            return(base.VisitPsiFile(psiFile, context));
        }
コード例 #3
0
 public override IEnumerable <string> VisitPsiExpression(IPsiExpression psiExpressionParam, PsiFmtStageContext context)
 {
     if (context.RightChild is IChoiceTail)
     {
         return(new[] { "\r\n" });
     }
     return(new[] { " " });
 }
コード例 #4
0
 public override IEnumerable <string> VisitOptionsDefinition(IOptionsDefinition optionsDefinitionParam, PsiFmtStageContext context)
 {
     return(new[] { "\r\n" });
 }
コード例 #5
0
 public override IEnumerable <string> VisitExtraDefinition(IExtraDefinition extraDefinitionParam, PsiFmtStageContext context)
 {
     return(new[] { " " });
 }
コード例 #6
0
 public override IEnumerable <string> VisitRuleBody(IRuleBody ruleBodyParam, PsiFmtStageContext context)
 {
     return(new[] { " " });
 }
コード例 #7
0
        public override IEnumerable <string> VisitRuleDeclaration(IRuleDeclaration ruleDeclarationParam, PsiFmtStageContext context)
        {
            if (context.LeftChild is IModifier)
            {
                return(new[] { " " });
            }
            if (context.RightChild is IRoleGetterParameter)
            {
                return(new[] { " " });
            }
            if (context.RightChild is IRuleBracketTypedParameters)
            {
                return(new[] { " " });
            }

            return(new[] { "\r\n" });
        }
コード例 #8
0
 public override IEnumerable <string> VisitChoiceTail(IChoiceTail choiceTailParam, PsiFmtStageContext context)
 {
     if (context.LeftChild is ICommentNode)
     {
         return(new[] { "\r\n" });
     }
     return(new[] { " " });
 }
コード例 #9
0
 public override IEnumerable <string> VisitParenExpression(IParenExpression parenExpressionParam, PsiFmtStageContext context)
 {
     if ((context.LeftChild is IPsiExpression) || (context.RightChild is IPsiExpression))
     {
         return(new[] { "\r\n" });
     }
     return(new[] { " " });
 }
コード例 #10
0
 private IEnumerable<string> CalcSpaces(PsiFmtStageContext context)
 {
   var psiTreeNode = context.Parent as IPsiTreeNode;
   return psiTreeNode != null ? psiTreeNode.Accept(myFmtVisitor, context) : null;
 }
コード例 #11
0
        private IEnumerable <string> CalcSpaces(PsiFmtStageContext context)
        {
            var psiTreeNode = context.Parent as IPsiTreeNode;

            return(psiTreeNode != null?psiTreeNode.Accept(myFmtVisitor, context) : null);
        }