JOJ3/internal/parsers/dummy/parser.go
张泊明518370910136 175685c074
All checks were successful
continuous-integration/drone/push Build is passing
feat: score & comment conf in result-status and dummy parser
2024-09-15 08:26:33 -04:00

27 lines
512 B
Go

package dummy
import (
"focs.ji.sjtu.edu.cn/git/FOCS-dev/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
}