From: Michael Stapelberg Date: Tue, 11 May 2010 21:00:31 +0000 (+0200) Subject: Implement 'restore' in new parser X-Git-Tag: tree-pr1~219 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c75a6732bf2a20823670a637e0108ae97bb9cfc3;p=i3%2Fi3 Implement 'restore' in new parser --- diff --git a/src/cmdparse.l b/src/cmdparse.l index 104926dc..55b1d28f 100644 --- a/src/cmdparse.l +++ b/src/cmdparse.l @@ -109,6 +109,7 @@ up { return TOK_UP; } down { return TOK_DOWN; } before { return TOK_BEFORE; } after { return TOK_AFTER; } +restore { BEGIN(WANT_WS_STRING); return TOK_RESTORE; } class { BEGIN(WANT_QSTRING); return TOK_CLASS; } id { BEGIN(WANT_QSTRING); return TOK_ID; } diff --git a/src/cmdparse.y b/src/cmdparse.y index 016f19e2..c1b30294 100644 --- a/src/cmdparse.y +++ b/src/cmdparse.y @@ -122,6 +122,7 @@ void parse_cmd(const char *new) { %token TOK_DOWN "down" %token TOK_AFTER "after" %token TOK_BEFORE "before" +%token TOK_RESTORE "restore" %token TOK_CLASS "class" %token TOK_ID "id" @@ -252,6 +253,7 @@ operation: | mark | layout | border */ + | restore | move | workspace | attach @@ -435,3 +437,11 @@ before_after: TOK_BEFORE { $$ = TOK_BEFORE; } | TOK_AFTER { $$ = TOK_AFTER; } ; + +restore: + TOK_RESTORE WHITESPACE STR + { + printf("restoring \"%s\"\n", $3); + tree_append_json($3); + } + ;