add filtering conditions message greater than, smaller than, and exactly matching...
[claws.git] / src / matcher_parser_lex.l
index f869273f785e4987f7c5daa35d4998151169bee6..f747e16c16eba0b6be77504e32eae8086f4cd8f2 100644 (file)
@@ -57,6 +57,10 @@ static void add_char(char ch)
 "~references"  return MATCHER_NOT_REFERENCES;
 "score_greater"        return MATCHER_SCORE_GREATER;
 "score_lower"  return MATCHER_SCORE_LOWER;
+"score_equal"  return MATCHER_SCORE_EQUAL;
+"size_greater"  return MATCHER_SIZE_GREATER;
+"size_smaller"  return MATCHER_SIZE_SMALLER;
+"size_equal"    return MATCHER_SIZE_EQUAL;
 "header"       return MATCHER_HEADER;
 "~header"      return MATCHER_NOT_HEADER;
 "headers_part" return MATCHER_HEADERS_PART;
@@ -81,6 +85,9 @@ static void add_char(char ch)
 "mark_as_unread"       return MATCHER_MARK_AS_UNREAD;
 "forward"             return MATCHER_FORWARD;
 "forward_as_attachment"              return MATCHER_FORWARD_AS_ATTACHMENT;
+"color"         return MATCHER_COLOR;
+"bounce"       return MATCHER_BOUNCE;
+"delete_on_server"     return MATCHER_DELETE_ON_SERVER;
 [ \t]+
 "\n"           return MATCHER_EOL;
 "&"            return MATCHER_AND;
@@ -89,27 +96,32 @@ static void add_char(char ch)
                BEGIN(string);
                string_buf_ptr = string_buf;
                }
-<string>\\n    add_char('\n');
-<string>\\t    add_char('\t');
-<string>\\r    add_char('\r');
-<string>\\b    add_char('\b');
-<string>\\f    add_char('\f');
-<string>\\.    add_char(yytext[1]);
+               /* alfons - OK, the new attempt is to just swallow 
+                * *EVERYTHING* and make sure everything is escaped
+                * when actually performing things. */
+<string>\\\"   {
+               /* take care of escaped \" because this means the
+                * quote char should be skipped */
+               add_char('\\');
+               add_char('\"');
+               }
 <string>\"     {
+               /* get out of the state: string ends. */
                BEGIN(0);
                *string_buf_ptr = '\0';
                yylval.str = string_buf;
                return MATCHER_STRING;
                }
+               /* put everything else in the output. */
 <string>.      {
-add_char(yytext[0]);
-}
+               add_char(yytext[0]);
+               }
 \[[^\[\]]*\]   {
-                       BEGIN(0);
-                       yylval.str = yytext + 1;
-                       yytext[strlen(yytext) - 1] = '\0';
-                       return MATCHER_SECTION;
-                       }
+               BEGIN(0);
+               yylval.str = yytext + 1;
+               yytext[strlen(yytext) - 1] = '\0';
+               return MATCHER_SECTION;
+               }
 [-+]?[0-9]+    {
                yylval.str = yytext;
                return MATCHER_INTEGER;