From 44da964dca43eff8e1cc7556b7b6e5917bd31d23 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 7 Aug 2019 22:30:26 -0400 Subject: [PATCH] pedantic: ast/argument.dart --- .../lib/src/language/ast/argument.dart | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/graphql_parser/lib/src/language/ast/argument.dart b/graphql_parser/lib/src/language/ast/argument.dart index 6639874a..f1150bd4 100644 --- a/graphql_parser/lib/src/language/ast/argument.dart +++ b/graphql_parser/lib/src/language/ast/argument.dart @@ -3,18 +3,31 @@ import '../token.dart'; import 'node.dart'; import 'input_value.dart'; +/// An argument passed to a [FieldContext]. class ArgumentContext extends Node { - final Token NAME, COLON; + /// The source tokens. + final Token nameToken, colon; + + /// The value of the argument. final InputValueContext value; - ArgumentContext(this.NAME, this.COLON, this.value); + ArgumentContext(this.nameToken, this.colon, this.value); /// Use [value] instead. @deprecated InputValueContext get valueOrVariable => value; - String get name => NAME.text; + /// Use [nameToken] instead. + @deprecated + Token get NAME => nameToken; + + /// Use [colon] instead. + @deprecated + Token get COLON => colon; + + /// The name of the argument, as a [String]. + String get name => nameToken.text; @override - FileSpan get span => NAME.span.expand(COLON.span).expand(value.span); + FileSpan get span => nameToken.span.expand(colon.span).expand(value.span); }