blob: 9c83fd8fcfae618e11ec4ef82812788e40df249a [file] [log] [blame]
package main
import (
"strings"
)
type Rule struct {
output string
inputs []string
cmds []string
filename string
lineno int
cmdLineno int
}
func (r *Rule) parse(line string) {
colonIndex := strings.IndexByte(line, ':')
if colonIndex < 0 {
Error(r.filename, r.lineno, "*** missing separator.")
}
lhs := line[:colonIndex]
r.output = lhs
r.inputs = splitSpaces(line[colonIndex+1:])
}