pedantic: var def

This commit is contained in:
Tobe O 2019-08-07 23:17:05 -04:00
parent 7f28d673e6
commit b245dde4fb
2 changed files with 15 additions and 2 deletions

View file

@ -5,15 +5,27 @@ import 'package:source_span/source_span.dart';
import 'type.dart'; import 'type.dart';
import 'variable.dart'; import 'variable.dart';
/// A single variable definition.
class VariableDefinitionContext extends Node { class VariableDefinitionContext extends Node {
final Token COLON; /// The source token.
final Token colonToken;
/// The declared variable.
final VariableContext variable; final VariableContext variable;
/// The type of the variable.
final TypeContext type; final TypeContext type;
/// The default value of the variable.
final DefaultValueContext defaultValue; final DefaultValueContext defaultValue;
VariableDefinitionContext(this.variable, this.COLON, this.type, VariableDefinitionContext(this.variable, this.colonToken, this.type,
[this.defaultValue]); [this.defaultValue]);
/// Use [colonToken] instead.
@deprecated
Token get COLON => colonToken;
@override @override
FileSpan get span => variable.span.expand(defaultValue?.span ?? type.span); FileSpan get span => variable.span.expand(defaultValue?.span ?? type.span);
} }

View file

@ -5,6 +5,7 @@ import 'variable_definition.dart';
/// A set of variable definitions in a GraphQL operation. /// A set of variable definitions in a GraphQL operation.
class VariableDefinitionsContext extends Node { class VariableDefinitionsContext extends Node {
/// The source tokens.
final Token lParenToken, rParenToken; final Token lParenToken, rParenToken;
/// The variables defined in this node. /// The variables defined in this node.