implement 'next' in the new command parser (testcase unfinished)

This commit is contained in:
Michael Stapelberg
2010-05-10 00:06:24 +02:00
parent f10a3d9b75
commit d8307f4b4a
5 changed files with 76 additions and 4 deletions

View File

@ -86,6 +86,7 @@ void parse_cmd(const char *new) {
%union {
char *string;
char chr;
}
%token TOK_ATTACH "attach"
@ -110,6 +111,7 @@ void parse_cmd(const char *new) {
%token TOK_FOCUS "focus"
%token TOK_MOVE "move"
%token TOK_OPEN "open"
%token TOK_NEXT "next"
%token TOK_CLASS "class"
%token TOK_ID "id"
@ -249,6 +251,7 @@ operation:
| kill
| open
| fullscreen
| next
;
exec:
@ -333,3 +336,18 @@ fullscreen:
}
;
next:
TOK_NEXT WHITESPACE direction
{
printf("should select next window in direction %c\n", $<chr>3);
tree_next('n', ($<chr>3 == 'v' ? VERT : HORIZ));
}
;
direction:
'h' { $<chr>$ = 'h'; }
| 'horizontal' { $<chr>$ = 'h'; }
| 'v' { $<chr>$ = 'v'; }
| 'vertical' { $<chr>$ = 'v'; }
;