]> git.sur5r.net Git - i3/i3/commitdiff
Add "instance" to matching criteria
authorMateusz Poszwa <old4@o2.pl>
Thu, 4 Aug 2011 15:12:54 +0000 (17:12 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 4 Aug 2011 18:10:31 +0000 (20:10 +0200)
src/cfgparse.l
src/cfgparse.y
src/cmdparse.l
src/cmdparse.y

index 2e1d240af58bf21a76e5f5e3e75f2b720c4ee422..4cf1a1c3777a5fd1f7a115c7cf85b3123764e055 100644 (file)
@@ -167,6 +167,7 @@ ctrl                            { return TOKCONTROL; }
 shift                           { return TOKSHIFT; }
 
 class                           { yy_push_state(WANT_QSTRING); return TOK_CLASS; }
+instance                        { yy_push_state(WANT_QSTRING); return TOK_INSTANCE; }
 id                              { yy_push_state(WANT_QSTRING); return TOK_ID; }
 con_id                          { yy_push_state(WANT_QSTRING); return TOK_CON_ID; }
 con_mark                        { yy_push_state(WANT_QSTRING); return TOK_MARK; }
index 38f306e9ef24e09be921a61ad8790688b0e54148..59b22c6c9ef15a9188e8e9f35fb4b97ece1772e8 100644 (file)
@@ -547,6 +547,7 @@ void parse_file(const char *f) {
 
 %token              TOK_MARK            "mark"
 %token              TOK_CLASS           "class"
+%token              TOK_INSTANCE        "instance"
 %token              TOK_ID              "id"
 %token              TOK_CON_ID          "con_id"
 %token              TOK_TITLE           "title"
@@ -694,6 +695,11 @@ criterion:
         printf("criteria: class = %s\n", $3);
         current_match.class = $3;
     }
+    | TOK_INSTANCE '=' STR
+    {
+        printf("criteria: instance = %s\n", $3);
+        current_match.instance = $3;
+    }
     | TOK_CON_ID '=' STR
     {
         printf("criteria: id = %s\n", $3);
index 898416c2443485d9228bf3d227600c9b651ad049..6c756b0d42850db11a014c5b1838ec3e21704ec4 100644 (file)
@@ -153,6 +153,7 @@ false                           { return TOK_DISABLE; }
 no                              { return TOK_DISABLE; }
 
 class                           { BEGIN(WANT_QSTRING); return TOK_CLASS; }
+instance                        { BEGIN(WANT_QSTRING); return TOK_INSTANCE; }
 id                              { BEGIN(WANT_QSTRING); return TOK_ID; }
 con_id                          { BEGIN(WANT_QSTRING); return TOK_CON_ID; }
 con_mark                        { BEGIN(WANT_QSTRING); return TOK_MARK; }
index e115f3e52293a8d958af635ef584f8d38d369cde..32558f2ea6af5f7b94a122451aa0e11340a3703d 100644 (file)
@@ -175,6 +175,7 @@ bool definitelyGreaterThan(float a, float b, float epsilon) {
 %token              TOK_NOP             "nop"
 
 %token              TOK_CLASS           "class"
+%token              TOK_INSTANCE        "instance"
 %token              TOK_ID              "id"
 %token              TOK_CON_ID          "con_id"
 %token              TOK_TITLE           "title"
@@ -300,6 +301,11 @@ criterion:
         printf("criteria: class = %s\n", $3);
         current_match.class = $3;
     }
+    | TOK_INSTANCE '=' STR
+    {
+        printf("criteria: instance = %s\n", $3);
+        current_match.instance = $3;
+    }
     | TOK_CON_ID '=' STR
     {
         printf("criteria: id = %s\n", $3);