1. upgrade bukkit chat 2. fix config update error Signed-off-by: MiaoWoo <admin@yumc.pw>
29 lines
491 B
TypeScript
29 lines
491 B
TypeScript
import { Expression } from '../expression'
|
|
|
|
export class StaticExpression extends Expression {
|
|
type = 'StaticExpression'
|
|
constructor(protected value: unknown, public readonly isReturn = false) {
|
|
super()
|
|
}
|
|
|
|
get allExpressions() {
|
|
return []
|
|
}
|
|
setExpressionAt() {}
|
|
|
|
isStatic() {
|
|
return true
|
|
}
|
|
|
|
eval() {
|
|
return this.value
|
|
}
|
|
toString() {
|
|
let val = this.value
|
|
if (typeof val === 'string') val = `'${val}'`
|
|
|
|
if (this.isReturn) return `return ${val}`
|
|
return '' + val
|
|
}
|
|
}
|