コード例 #1
0
        public override void VisitFunctionCallSyntax(FunctionCallSyntax syntax) =>
        this.Build(() => base.VisitFunctionCallSyntax(syntax), children =>
        {
            Debug.Assert(children.Length >= 3);

            ILinkedDocument name       = children[0];
            ILinkedDocument openParen  = children[1];
            ILinkedDocument arguments  = Spread(children.Skip(2).SkipLast(1));
            ILinkedDocument closeParen = children[^ 1];
コード例 #2
0
        public override void VisitForVariableBlockSyntax(ForVariableBlockSyntax syntax) =>
        this.Build(() => base.VisitForVariableBlockSyntax(syntax), children =>
        {
            Debug.Assert(children.Length == 5);

            ILinkedDocument openParen     = children[0];
            ILinkedDocument itemVariable  = children[1];
            ILinkedDocument comma         = children[2];
            ILinkedDocument indexVariable = children[3];
            ILinkedDocument closeParen    = children[4];

            return(Spread(Concat(openParen, itemVariable, comma), Concat(indexVariable, closeParen)));
        });
コード例 #3
0
        public override void VisitForSyntax(ForSyntax syntax) =>
        this.Build(() => base.VisitForSyntax(syntax), children =>
        {
            Debug.Assert(children.Length == 8);

            ILinkedDocument openBracket     = children[0];
            ILinkedDocument forKeyword      = children[1];
            ILinkedDocument variableBlock   = children[2];
            ILinkedDocument inKeyword       = children[3];
            ILinkedDocument arrayExpression = children[4];
            ILinkedDocument colon           = children[5];
            ILinkedDocument loopBody        = children[6];
            ILinkedDocument closeBracket    = children[7];

            return(Concat(openBracket, Spread(forKeyword, variableBlock, inKeyword, arrayExpression), Spread(colon, loopBody), closeBracket));
        });
コード例 #4
0
ファイル: TextDocument.cs プロジェクト: yane3628/bicep
 public TextDocument(string text, ILinkedDocument successor)
 {
     Text      = text;
     Successor = successor;
 }
コード例 #5
0
ファイル: TextDocument.cs プロジェクト: yane3628/bicep
 public ILinkedDocument Concat(ILinkedDocument other)
 {
     return(new TextDocument(this.Text, Successor.Concat(other)));
 }
コード例 #6
0
ファイル: NestDocument.cs プロジェクト: yane3628/bicep
 public NestDocument(int level, ILinkedDocument successor)
 {
     this.Level     = level;
     this.Successor = successor;
 }
コード例 #7
0
ファイル: NestDocument.cs プロジェクト: yane3628/bicep
 public ILinkedDocument Concat(ILinkedDocument other)
 {
     return(new NestDocument(this.Level, this.Successor.Concat(other)));
 }
コード例 #8
0
ファイル: NestDocument.cs プロジェクト: Princetimber/bicep-1
 public ILinkedDocument Concat(ILinkedDocument other)
 {
     return(new NestDocument(this.level, this.successors.Add(other)));
 }
コード例 #9
0
 public ILinkedDocument Concat(ILinkedDocument other)
 {
     return(new TextDocument(this.text, this.successors.Add(other)));
 }
コード例 #10
0
 public ILinkedDocument Concat(ILinkedDocument other)
 {
     return(other);
 }