commit | 19f4bf62fe8369d262c8589fb1ba1c7990bfcf71 | [log] [tgz] |
---|---|---|
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | Thu Apr 02 04:55:57 2015 +0900 |
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | Thu Apr 02 04:55:57 2015 +0900 |
tree | ca54682443d430d54c0cc5f8f2fb517d49943b45 | |
parent | cc3abc389f4f7ec43c2c596cd97673d02143e8de [diff] [blame] |
Implement recipe in rule (aka ;)
diff --git a/parser.go b/parser.go index 3b01d30..62836a7 100644 --- a/parser.go +++ b/parser.go
@@ -119,8 +119,12 @@ Error(p.filename, p.lineno, "*** commands commence before first target.") } - ast := &MaybeRuleAST{ - expr: line, + ast := &MaybeRuleAST{} + if i := strings.IndexByte(line, ';'); i >= 0 { + ast.expr = line[:i] + ast.cmds = append(ast.cmds, strings.TrimSpace(line[i+1:])) + } else { + ast.expr = line } ast.filename = p.filename ast.lineno = p.lineno