2019-03-17 23:45:48 -05:00
|
|
|
export class Literal {
|
|
|
|
|
2019-05-05 04:26:35 -05:00
|
|
|
static type() {
|
|
|
|
return 'literal';
|
|
|
|
}
|
|
|
|
|
2019-03-17 23:45:48 -05:00
|
|
|
constructor() {
|
|
|
|
this.value = null;
|
|
|
|
}
|
|
|
|
|
2019-04-25 00:48:53 -05:00
|
|
|
clone(other) {
|
|
|
|
this.value = other.value;
|
|
|
|
}
|
|
|
|
|
2019-03-17 23:45:48 -05:00
|
|
|
fromJSON(json) {
|
|
|
|
this.value = json.value;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
get(context) {
|
|
|
|
return this.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
set(value) {
|
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
toJSON() {
|
|
|
|
return {
|
|
|
|
type: 'literal',
|
|
|
|
value: this.value,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|