platform/lib/src/language/ast/fragment_spread.dart

23 lines
537 B
Dart
Raw Normal View History

2017-01-22 23:15:53 +00:00
import '../token.dart';
import 'directive.dart';
import 'node.dart';
import 'package:source_span/source_span.dart';
class FragmentSpreadContext extends Node {
final Token ELLIPSIS, NAME;
final List<DirectiveContext> directives = [];
FragmentSpreadContext(this.ELLIPSIS, this.NAME);
@override
SourceSpan get span {
SourceLocation end;
return new SourceSpan(ELLIPSIS.span?.start, end, toSource());
}
@override
String toSource() {
return '...${NAME.text}' + directives.map((d) => d.toSource()).join();
}
}