aboutsummaryrefslogtreecommitdiff
path: root/exec.go
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-04-13 21:41:22 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-04-13 21:41:22 +0900
commitbb9772dbb35e84f862f6cc5ddfe8cd6015d2dc48 (patch)
treede008f701a7395e34967119546aeb382c6a39144 /exec.go
parentee8b33c24a07ed3ba09dabbe6b9be359ee3ba307 (diff)
downloadkati-bb9772dbb35e84f862f6cc5ddfe8cd6015d2dc48.tar.gz
Partially implement $*
Diffstat (limited to 'exec.go')
-rw-r--r--exec.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/exec.go b/exec.go
index 6db0acb..ee95861 100644
--- a/exec.go
+++ b/exec.go
@@ -72,6 +72,13 @@ func (v AutoPlusVar) Eval(w io.Writer, ev *Evaluator) {
fmt.Fprint(w, strings.Join(v.ex.currentInputs, " "))
}
+type AutoStarVar struct{ AutoVar }
+
+func (v AutoStarVar) Eval(w io.Writer, ev *Evaluator) {
+ // TODO: Use currentStem. See auto_stem_var.mk
+ fmt.Fprint(w, stripExt(v.ex.currentOutput))
+}
+
type AutoSuffixDVar struct {
AutoVar
v Var
@@ -117,6 +124,7 @@ func newExecutor(vars Vars) *Executor {
"<": AutoLessVar{AutoVar: AutoVar{ex: ex}},
"^": AutoHatVar{AutoVar: AutoVar{ex: ex}},
"+": AutoPlusVar{AutoVar: AutoVar{ex: ex}},
+ "*": AutoStarVar{AutoVar: AutoVar{ex: ex}},
} {
ex.vars[k] = v
ex.vars[k+"D"] = AutoSuffixDVar{v: v}