Define a Constant node for constants

This commit is contained in:
Eryn Wells 2016-12-29 12:33:20 -05:00
parent 8f2a93f813
commit 4cfd0510e6

View file

@ -2,4 +2,18 @@
* Eryn Wells <eryn@erynwells.me>
*/
use types::boolean::Boolean;
use types::{Boolean, Number};
trait ConstantValue {}
impl ConstantValue for Boolean {}
impl ConstantValue for Number {}
struct Constant<V: ConstantValue> {
value: V
}
impl<V: ConstantValue> Constant<V> {
fn new(value: V) -> Constant<V> {
Constant { value: value }
}
}