pedantic: ast/array_value.dart

This commit is contained in:
Tobe O 2019-08-07 22:33:11 -04:00
parent b1787d9c8d
commit 5f178c4a13

View file

@ -2,16 +2,28 @@ import 'package:source_span/source_span.dart';
import '../token.dart'; import '../token.dart';
import 'input_value.dart'; import 'input_value.dart';
/// A GraphQL list value literal.
class ListValueContext extends InputValueContext { class ListValueContext extends InputValueContext {
final Token LBRACKET, RBRACKET; /// The source tokens.
final Token lBracket, rBracket;
/// The child values.
final List<InputValueContext> values = []; final List<InputValueContext> values = [];
ListValueContext(this.LBRACKET, this.RBRACKET); ListValueContext(this.lBracket, this.rBracket);
/// Use [lBracket] instead.
@deprecated
Token get LBRACKET => lBracket;
/// Use [rBracket] instead.
@deprecated
Token get RBRACKET => rBracket;
@override @override
FileSpan get span { FileSpan get span {
var out = values.fold<FileSpan>(LBRACKET.span, (o, v) => o.expand(v.span)); var out = values.fold<FileSpan>(lBracket.span, (o, v) => o.expand(v.span));
return out.expand(RBRACKET.span); return out.expand(rBracket.span);
} }
@override @override