platform/graphql_parser/lib/src/language/ast/boolean_value.dart
2018-08-02 09:25:41 -04:00

20 lines
455 B
Dart

import '../token.dart';
import 'package:source_span/source_span.dart';
import 'value.dart';
class BooleanValueContext extends ValueContext {
bool _valueCache;
final Token BOOLEAN;
BooleanValueContext(this.BOOLEAN) {
assert(BOOLEAN?.text == 'true' || BOOLEAN?.text == 'false');
}
bool get booleanValue => _valueCache ??= BOOLEAN.text == 'true';
@override
get value => booleanValue;
@override
FileSpan get span => BOOLEAN.span;
}