Files
ms/packages/molang/src/parser/expressions/postfix.ts
MiaoWoo 6816e51239 feat: add molang package
1. upgrade bukkit chat
2. fix config update error

Signed-off-by: MiaoWoo <admin@yumc.pw>
2022-02-12 16:29:40 +08:00

33 lines
566 B
TypeScript

import { TTokenType } from '../../tokenizer/token'
import { Expression, IExpression } from '../expression'
export class PostfixExpression extends Expression {
type = 'PostfixExpression'
constructor(
protected expression: IExpression,
protected tokenType: TTokenType
) {
super()
}
get allExpressions() {
return [this.expression]
}
setExpressionAt(_: number, expr: IExpression) {
this.expression = expr
}
isStatic() {
return this.expression.isStatic()
}
eval() {
switch (this.tokenType) {
case 'X': {
// DO SOMETHING
}
}
}
}