Skip to content

Commit

Permalink
fix action not being processed.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasefe committed Aug 1, 2016
1 parent 39aec4d commit 363bd7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/.ta
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ tres c echo izquierda arriba
tres v echo derecha arriba
tres h echo derecha abajo
tres 1h echo izquierda abajo
cuatro c
cuatro v
cuatro h echo abajo derecha
4 changes: 3 additions & 1 deletion parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func killCommands(session string) Args {
}

func ParseLine(line string) (map[string]string, error) {
var re = regexp.MustCompile(`(?P<window>[a-z]*)\s(?P<target>\d?)(?P<operation>[cvha])(?P<action>.*?)`)
var re = regexp.MustCompile(`(?P<window>[a-z]*)\s(?P<target>\d?)(?P<operation>[cvha])\s?(?P<action>.*)`)
match := re.FindStringSubmatch(line)
captures := make(map[string]string)

Expand All @@ -143,5 +143,7 @@ func ParseLine(line string) (map[string]string, error) {
captures[name] = match[i]
}

log.Printf("%+v", captures)

return captures, nil
}

0 comments on commit 363bd7d

Please sign in to comment.