From 7f28d673e6950a6c40bba6464a26337a07a8d18e Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 7 Aug 2019 23:14:51 -0400 Subject: [PATCH] pedantic: var defs --- .../language/ast/variable_definitions.dart | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/graphql_parser/lib/src/language/ast/variable_definitions.dart b/graphql_parser/lib/src/language/ast/variable_definitions.dart index 852ee94e..fd1fbafd 100644 --- a/graphql_parser/lib/src/language/ast/variable_definitions.dart +++ b/graphql_parser/lib/src/language/ast/variable_definitions.dart @@ -3,16 +3,27 @@ import 'node.dart'; import 'package:source_span/source_span.dart'; import 'variable_definition.dart'; +/// A set of variable definitions in a GraphQL operation. class VariableDefinitionsContext extends Node { - final Token LPAREN, RPAREN; + final Token lParenToken, rParenToken; + + /// The variables defined in this node. final List variableDefinitions = []; - VariableDefinitionsContext(this.LPAREN, this.RPAREN); + VariableDefinitionsContext(this.lParenToken, this.rParenToken); + + /// Use [lParenToken] instead. + @deprecated + Token get LPAREN => lParenToken; + + /// Use [rParenToken] instead. + @deprecated + Token get RPAREN => rParenToken; @override FileSpan get span { var out = variableDefinitions.fold( - LPAREN.span, (o, v) => o.expand(v.span)); - return out.expand(RPAREN.span); + lParenToken.span, (o, v) => o.expand(v.span)); + return out.expand(rParenToken.span); } }