JOJ3/internal/parsers/dummy/parser.go
张泊明518370910136 a9a829da3f
Some checks failed
build-image / create-empty-commit (push) Failing after 4s
checks / build (push) Successful in 1m20s
feat: rename module
2024-09-30 17:38:40 -04:00

27 lines
507 B
Go

package dummy
import (
"focs.ji.sjtu.edu.cn/git/JOJ/JOJ3/internal/stage"
)
type Conf struct {
Score int
Comment string
}
type Dummy struct{}
func (*Dummy) Run(results []stage.ExecutorResult, confAny any) (
[]stage.ParserResult, bool, error,
) {
conf, err := stage.DecodeConf[Conf](confAny)
if err != nil {
return nil, true, err
}
var res []stage.ParserResult
for range results {
res = append(res, stage.ParserResult{Score: conf.Score, Comment: conf.Comment})
}
return res, false, nil
}