feat: add molang package
1. upgrade bukkit chat 2. fix config update error Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
12
packages/molang/src/parser/parselets/number.ts
Normal file
12
packages/molang/src/parser/parselets/number.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { IPrefixParselet } from './prefix'
|
||||
import { Token } from '../../tokenizer/token'
|
||||
import { Parser } from '../parse'
|
||||
import { NumberExpression } from '../expressions/number'
|
||||
|
||||
export class NumberParselet implements IPrefixParselet {
|
||||
constructor(public precedence = 0) {}
|
||||
|
||||
parse(parser: Parser, token: Token) {
|
||||
return new NumberExpression(Number(token.getText()))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user