pedantic: ast/boolean_value.dart
This commit is contained in:
parent
5f178c4a13
commit
a1ce812088
1 changed files with 13 additions and 5 deletions
|
@ -2,18 +2,26 @@ import 'package:source_span/source_span.dart';
|
||||||
import 'input_value.dart';
|
import 'input_value.dart';
|
||||||
import '../token.dart';
|
import '../token.dart';
|
||||||
|
|
||||||
|
/// A GraphQL boolean value literal.
|
||||||
class BooleanValueContext extends InputValueContext<bool> {
|
class BooleanValueContext extends InputValueContext<bool> {
|
||||||
bool _valueCache;
|
bool _valueCache;
|
||||||
final Token BOOLEAN;
|
|
||||||
|
|
||||||
BooleanValueContext(this.BOOLEAN) {
|
/// The source token.
|
||||||
assert(BOOLEAN?.text == 'true' || BOOLEAN?.text == 'false');
|
final Token boolean;
|
||||||
|
|
||||||
|
BooleanValueContext(this.boolean) {
|
||||||
|
assert(boolean?.text == 'true' || boolean?.text == 'false');
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get booleanValue => _valueCache ??= BOOLEAN.text == 'true';
|
/// The [bool] value of this literal.
|
||||||
|
bool get booleanValue => _valueCache ??= boolean.text == 'true';
|
||||||
|
|
||||||
|
/// Use [boolean] instead.
|
||||||
|
@deprecated
|
||||||
|
Token get BOOLEAN => boolean;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FileSpan get span => BOOLEAN.span;
|
FileSpan get span => boolean.span;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool computeValue(Map<String, dynamic> variables) => booleanValue;
|
bool computeValue(Map<String, dynamic> variables) => booleanValue;
|
||||||
|
|
Loading…
Reference in a new issue