From a79f6c51c1ff0c1b29c3e40c9cf775c068716d3f Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 7 Aug 2019 23:07:32 -0400 Subject: [PATCH] pedantic: number_value --- .../lib/src/language/ast/number_value.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/graphql_parser/lib/src/language/ast/number_value.dart b/graphql_parser/lib/src/language/ast/number_value.dart index d5fe010d..733bf0e4 100644 --- a/graphql_parser/lib/src/language/ast/number_value.dart +++ b/graphql_parser/lib/src/language/ast/number_value.dart @@ -3,13 +3,16 @@ import 'package:source_span/source_span.dart'; import '../token.dart'; import 'input_value.dart'; +/// A GraphQL number literal. class NumberValueContext extends InputValueContext { - final Token NUMBER; + /// The source token. + final Token numberToken; - NumberValueContext(this.NUMBER); + NumberValueContext(this.numberToken); + /// The [num] value of the [numberToken]. num get numberValue { - var text = NUMBER.text; + var text = numberToken.text; if (!text.contains('E') && !text.contains('e')) { return num.parse(text); } else { @@ -20,8 +23,12 @@ class NumberValueContext extends InputValueContext { } } + /// Use [numberToken] instead. + @deprecated + Token get NUMBER => numberToken; + @override - FileSpan get span => NUMBER.span; + FileSpan get span => numberToken.span; @override num computeValue(Map variables) => numberValue;