<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/main/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'main/command.go')
-rw-r--r--main/command.go60
1 files changed, 0 insertions, 60 deletions
diff --git a/main/command.go b/main/command.go
index e676255..7d44309 100644
--- a/main/command.go
+++ b/main/command.go
@@ -16,41 +16,6 @@ func (cmd PrintValueCommand) exec(state *ProgramState) {
}
}
-type ToggleTerminalCommand struct {}
-func (cmd ToggleTerminalCommand) exec(state *ProgramState) {
- toggled := map[walk.TerminalValue]walk.TerminalValue {
- walk.ArrayBegin: walk.MapBegin,
- walk.ArrayEnd: walk.MapEnd,
- walk.MapBegin: walk.ArrayBegin,
- walk.MapEnd: walk.ArrayEnd,
- }
-
- for i := range state.value {
- terminal, isTerminal := state.value[i].(walk.TerminalValue)
- if !isTerminal {
- continue
- }
- state.value[i] = toggled[terminal]
- }
-}
-
-type FilteredCommand struct {
- filter Filter
- command Command
-}
-func (cmd FilteredCommand) exec(state *ProgramState) {
- path := walk.PathFromWalkValues(state.path)
- for _, value := range state.value {
- if cmd.filter.exec(walk.WalkItem {
- Value: value,
- Path: path,
- }) {
- cmd.command.exec(state)
- return
- }
- }
-}
-
type SequenceCommand struct {
commands []Command
}
@@ -60,22 +25,6 @@ func (cmd SequenceCommand) exec(state *ProgramState) {
}
}
-type AppendLiteralCommand struct {
- values []walk.WalkValue
-}
-func (cmd AppendLiteralCommand) exec(state *ProgramState) {
- state.value = append(state.value, cmd.values...)
-}
-
-type PrependLiteralCommand struct {
- values []walk.WalkValue
-}
-func (cmd PrependLiteralCommand) exec(state *ProgramState) {
- var newItems []walk.WalkValue
- newItems = append(newItems, cmd.values...)
- state.value = append(newItems, state.value...)
-}
-
type NextCommand struct {}
func (cmd NextCommand) exec(state *ProgramState) {
nextItem := <- state.in
@@ -90,15 +39,6 @@ func (cmd AppendNextCommand) exec(state *ProgramState) {
state.path = nextItem.Path.ToWalkValues()
}
-type PrintLiteralsCommand struct {
- items []walk.WalkItem
-}
-func (cmd PrintLiteralsCommand) exec(state *ProgramState) {
- for _, item := range cmd.items {
- state.out <- item
- }
-}
-
type DeleteAllCommand struct {}
func (cmd DeleteAllCommand) exec(state *ProgramState) {
state.path = nil