pedantic: ast/argument.dart
This commit is contained in:
parent
29d840d7da
commit
44da964dca
1 changed files with 17 additions and 4 deletions
|
@ -3,18 +3,31 @@ import '../token.dart';
|
||||||
import 'node.dart';
|
import 'node.dart';
|
||||||
import 'input_value.dart';
|
import 'input_value.dart';
|
||||||
|
|
||||||
|
/// An argument passed to a [FieldContext].
|
||||||
class ArgumentContext extends Node {
|
class ArgumentContext extends Node {
|
||||||
final Token NAME, COLON;
|
/// The source tokens.
|
||||||
|
final Token nameToken, colon;
|
||||||
|
|
||||||
|
/// The value of the argument.
|
||||||
final InputValueContext value;
|
final InputValueContext value;
|
||||||
|
|
||||||
ArgumentContext(this.NAME, this.COLON, this.value);
|
ArgumentContext(this.nameToken, this.colon, this.value);
|
||||||
|
|
||||||
/// Use [value] instead.
|
/// Use [value] instead.
|
||||||
@deprecated
|
@deprecated
|
||||||
InputValueContext get valueOrVariable => value;
|
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
|
@override
|
||||||
FileSpan get span => NAME.span.expand(COLON.span).expand(value.span);
|
FileSpan get span => nameToken.span.expand(colon.span).expand(value.span);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue