From c75a6732bf2a20823670a637e0108ae97bb9cfc3 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 11 May 2010 23:00:31 +0200 Subject: [PATCH] Implement 'restore' in new parser --- src/cmdparse.l | 1 + src/cmdparse.y | 10 ++++++++++ 2 files changed, 11 insertions(+) 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); + } + ; -- 2.39.5