public ErlangListComprehensionSyntax( ErlangLeftBracketToken leftBracket, ErlangExpressionSyntax expression, ErlangPipePipeToken doublePipe, IEnumerable <ErlangSeparatedSyntaxNodeSyntax <ErlangListComprehensionGeneratorSyntax> > generators, IEnumerable <ErlangSeparatedSyntaxNodeSyntax <ErlangListComprehensionFilterSyntax> > filters, ErlangRightBracketToken rightBracket) : base(leftBracket, rightBracket) { Expression = expression; DoublePipe = doublePipe; Generators = new SyntaxList <ErlangSeparatedSyntaxNodeSyntax <ErlangListComprehensionGeneratorSyntax> >(generators); Filters = new SyntaxList <ErlangSeparatedSyntaxNodeSyntax <ErlangListComprehensionFilterSyntax> >(filters); }
private static ErlangListComprehensionSyntax ParseListComprehension(ErlangLeftBracketToken leftBracket, ErlangExpressionSyntax expression, ErlangPipePipeToken doublePipe, TokenBuffer buffer, ParseStyle style) { var generators = ParseSyntaxListWithComma(buffer, style, ErlangListComprehensionGeneratorSyntax.Parse); var filters = ParseSyntaxListWithComma(buffer, style, ErlangListComprehensionFilterSyntax.Parse); ErlangRightBracketToken rightBracket = null; var right = buffer.Peek(); if (ErlangToken.IsRightBracket(right)) { buffer.Advance(); rightBracket = (ErlangRightBracketToken)right; } return(new ErlangListComprehensionSyntax(leftBracket, expression, doublePipe, generators, filters, rightBracket)); }