Natalie Weizenbaum faa86b697c Make (most) spans mandatory.
Arguments are still optional since they may be constructed for
user-defined arguments.
2016-08-30 15:51:23 -07:00

25 lines
768 B
Dart

// Copyright 2016 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
import 'package:source_span/source_span.dart';
import '../../../utils.dart';
import '../../../visitor/interface/expression.dart';
import '../expression.dart';
class MapExpression implements Expression {
final List<List<Expression>> pairs;
final FileSpan span;
MapExpression(Iterable<Pair<Expression, Expression>> pairs, this.span)
: pairs = new List.unmodifiable(pairs);
/*=T*/ accept/*<T>*/(ExpressionVisitor/*<T>*/ visitor) =>
visitor.visitMapExpression(this);
String toString() =>
'(${pairs.map((pair) => '${pair.first}: ${pair.last}').join(', ')})';
}