diff --git a/go.mod b/go.mod index 7ae42252..2c473f7b 100644 --- a/go.mod +++ b/go.mod @@ -6,13 +6,13 @@ require ( github.com/gopherjs/gopherjs v1.18.0-beta1 github.com/peterh/liner v1.2.2 github.com/stretchr/testify v1.8.0 + golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/mattn/go-runewidth v0.0.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect golang.org/x/sys v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/types.go b/types.go index 8734890e..0812ab52 100644 --- a/types.go +++ b/types.go @@ -96,10 +96,9 @@ type RollConfig struct { } type customDiceItem struct { - expr string - callback func(ctx *Context, groups []string) *VMValue - - parse func(ctx *Context, p *parser) + // expr string + // callback func(ctx *Context, groups []string) *VMValue + // parse func(ctx *Context, p *parser) // 该怎样写呢?似乎将一些解析相关的struct暴露出去并不合适 // 这里我有三个选项,第一种是创建一种更简单的语法进行编译:例如