public UstNode VisitArgs([NotNull] DslParser.ArgsContext context) { List <Expression> expressions = context.arg().Select(arg => (Expression)VisitArg(arg)).ToList(); var span = context.GetTextSpan(); ArgsNode result; if (expressions.All(expr => expr.NodeType != NodeType.PatternMultipleExpressions)) { result = new ArgsNode(expressions, span, null); } else { result = new PatternExpressions() { Collection = expressions, TextSpan = span }; } return(result); }
public PatternUst VisitArgs([NotNull] DslParser.ArgsContext context) { IEnumerable <PatternUst> expressions = context.arg().Select(arg => (PatternUst)VisitArg(arg)); var textSpan = context.GetTextSpan(); PatternArgs result; if (expressions.All(expr => !(expr is PatternMultipleExpressions))) { result = new PatternArgs(expressions) { TextSpan = textSpan }; } else { result = new PatternArgs(expressions) { TextSpan = textSpan }; } return(result); }