diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-04-13 21:41:22 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-04-13 21:41:22 +0900 |
commit | bb9772dbb35e84f862f6cc5ddfe8cd6015d2dc48 (patch) | |
tree | de008f701a7395e34967119546aeb382c6a39144 /exec.go | |
parent | ee8b33c24a07ed3ba09dabbe6b9be359ee3ba307 (diff) | |
download | kati-bb9772dbb35e84f862f6cc5ddfe8cd6015d2dc48.tar.gz |
Partially implement $*
Diffstat (limited to 'exec.go')
-rw-r--r-- | exec.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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} |