]> git.sur5r.net Git - i3/i3/commitdiff
Implement 'restore' in new parser
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 11 May 2010 21:00:31 +0000 (23:00 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 11 May 2010 21:00:31 +0000 (23:00 +0200)
src/cmdparse.l
src/cmdparse.y

index 104926dcb2c59b210bb89460b5152b8f38d8c053..55b1d28f65d0e9bb29056ab9b69154cbbc954d3d 100644 (file)
@@ -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; }
index 016f19e2507fb073f82f0e2af0d8c76abb5eba17..c1b302946035f8e0d5fc0cd310046284626b6a44 100644 (file)
@@ -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 { $<number>$ = TOK_BEFORE; }
     | TOK_AFTER { $<number>$ = TOK_AFTER; }
     ;
+
+restore:
+    TOK_RESTORE WHITESPACE STR
+    {
+        printf("restoring \"%s\"\n", $<string>3);
+        tree_append_json($<string>3);
+    }
+    ;