Deprecate value in favor of constant; valueorvariable -> input value

This commit is contained in:
Tobe O 2019-08-07 21:38:53 -04:00
parent c2b48ad39e
commit 225a83078b
4 changed files with 27 additions and 21 deletions

View file

@ -0,0 +1,11 @@
import 'node.dart';
abstract class ConstantContext<T> extends Node {
T get value;
}
/// Use [ConstantContext] instead. This class remains solely for backwards compatibility.
@deprecated
abstract class ValueContext<T> extends ConstantContext<T> {
T get value;
}

View file

@ -0,0 +1,16 @@
import 'package:source_span/source_span.dart';
import 'constant.dart';
import 'node.dart';
import 'variable.dart';
class InputValueContext extends Node {
final ConstantContext constant;
final VariableContext variable;
InputValueContext(this.constant, this.variable) {
assert(constant != null || variable != null);
}
@override
FileSpan get span => constant?.span ?? variable.span;
}

View file

@ -1,5 +0,0 @@
import 'node.dart';
abstract class ValueContext<T> extends Node {
T get value;
}

View file

@ -1,16 +0,0 @@
import 'node.dart';
import 'package:source_span/source_span.dart';
import 'value.dart';
import 'variable.dart';
class ValueOrVariableContext extends Node {
final ValueContext value;
final VariableContext variable;
ValueOrVariableContext(this.value, this.variable) {
assert(value != null || variable != null);
}
@override
FileSpan get span => value?.span ?? variable.span;
}