pedantic: ast/argument.dart

This commit is contained in:
Tobe O 2019-08-07 22:30:26 -04:00
parent 29d840d7da
commit 44da964dca

View file

@ -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);
}