From c83c9e1fc3afc1386f1e610d403fc4bef30f01bd Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 7 Aug 2019 22:57:27 -0400 Subject: [PATCH] ListType: pedantic + type->innerType --- .../lib/src/language/ast/list_type.dart | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/graphql_parser/lib/src/language/ast/list_type.dart b/graphql_parser/lib/src/language/ast/list_type.dart index ea8ef20c..ee770e00 100644 --- a/graphql_parser/lib/src/language/ast/list_type.dart +++ b/graphql_parser/lib/src/language/ast/list_type.dart @@ -3,12 +3,29 @@ import 'node.dart'; import 'package:source_span/source_span.dart'; import 'type.dart'; +/// Represents a type that holds a list of another type. class ListTypeContext extends Node { - final Token LBRACKET, RBRACKET; - final TypeContext type; + /// The source tokens. + final Token lBracketToken, rBracketToken; - ListTypeContext(this.LBRACKET, this.type, this.RBRACKET); + /// The inner type. + final TypeContext innerType; + + ListTypeContext(this.lBracketToken, this.innerType, this.rBracketToken); + + /// Use [innerType] instead. + @deprecated + TypeContext get type => innerType; + + /// Use [lBracketToken] instead. + @deprecated + Token get LBRACKET => lBracketToken; + + /// Use [rBracketToken] instead. + @deprecated + Token get RBRACKET => rBracketToken; @override - FileSpan get span => LBRACKET.span.expand(type.span).expand(RBRACKET.span); + FileSpan get span => + lBracketToken.span.expand(innerType.span).expand(rBracketToken.span); }