MCPcopy Create free account
hub / github.com/github/gh-aw / tokenize

Method tokenize

pkg/parser/schedule_parser.go:62–75  ·  view source on GitHub ↗

tokenize breaks the input into tokens

()

Source from the content-addressed store, hash-verified

60
61// tokenize breaks the input into tokens
62func (p *ScheduleParser) tokenize() error {
63 // Normalize the input
64 input := strings.ToLower(strings.TrimSpace(p.input))
65
66 // Split on whitespace
67 tokens := strings.Fields(input)
68 if len(tokens) == 0 {
69 return errors.New("empty schedule expression")
70 }
71
72 p.tokens = tokens
73 p.pos = 0
74 return nil
75}
76
77// parse parses the tokens into a cron expression
78func (p *ScheduleParser) parse() (string, error) {

Callers 1

ParseScheduleFunction · 0.95

Calls 1

ToLowerMethod · 0.80

Tested by

no test coverage detected