diff --git a/src/cfgparse.l b/src/cfgparse.l index e29f6efc..12840f26 100644 --- a/src/cfgparse.l +++ b/src/cfgparse.l @@ -75,6 +75,14 @@ EOL (\r?\n) "]" { yy_pop_state(); return ']'; } +"[" { + /* this is the case for the new assign syntax + * that uses criteria */ + yy_pop_state(); + yy_push_state(FOR_WINDOW_COND); + /* afterwards we will be in ASSIGN_TARGET_COND */ + return '['; + } [ \t]* { yy_pop_state(); } \"[^\"]+\" { yy_pop_state(); @@ -194,7 +202,7 @@ title { yy_push_state(WANT_QSTRING); return TOK_TITLE; yylval.string = copy; return QUOTEDSTRING; } -[^ \t\"]+ { BEGIN(ASSIGN_TARGET_COND); yylval.string = sstrdup(yytext); return STR_NG; } +[^ \t\"\[]+ { BEGIN(ASSIGN_TARGET_COND); yylval.string = sstrdup(yytext); return STR_NG; } [a-zA-Z0-9_]+ { yylval.string = sstrdup(yytext); return WORD; } [a-zA-Z]+ { yylval.string = sstrdup(yytext); return WORD; } . { return (int)yytext[0]; } diff --git a/src/cfgparse.y b/src/cfgparse.y index ca2d0710..53d23815 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -1137,6 +1137,15 @@ assign: assignment->dest.workspace = workspace; TAILQ_INSERT_TAIL(&assignments, assignment, assignments); } + | TOKASSIGN match STR + { + printf("new assignment, using above criteria, to workspace %s\n", $3); + Assignment *assignment = scalloc(sizeof(Assignment)); + assignment->match = current_match; + assignment->type = A_TO_WORKSPACE; + assignment->dest.workspace = $3; + TAILQ_INSERT_TAIL(&assignments, assignment, assignments); + } ; window_class: