]> arthur.barton.de Git - netatalk.git/blobdiff - etc/spotlight/spotlight_rawquery_lexer.l
Support for using $u username variable in AFP volume definitions
[netatalk.git] / etc / spotlight / spotlight_rawquery_lexer.l
index bbfcad50a963b6a8013d06c541abecb6f3d54474..aa1e25f9c70415ff18024167267933f79ab1c569 100644 (file)
@@ -9,15 +9,26 @@
 #include <gio/gio.h>
 #include <atalk/talloc.h>
 #include <atalk/spotlight.h>
+#ifdef HAVE_TRACKER_SPARQL
 #include "slmod_sparql_parser.h"
+#define SLQ_VAR ssp_slq
+#endif
 %}
 
+ASC     [a-zA-Z0-9_\*\:\-\.]
+U       [\x80-\xbf]
+U2      [\xc2-\xdf]
+U3      [\xe0-\xef]
+U4      [\xf0-\xf4]
+
+UANY    {ASC}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
+UONLY   {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
+
 %%
 InRange                               return FUNC_INRANGE;
 \$time\.iso                           return DATE_ISO;
 false                                 {yylval.bval = false; return BOOL;}
 true                                  {yylval.bval = true; return BOOL;}
-[a-zA-Z0-9_\*\:\-\.]+                 {yylval.sval = talloc_strdup(ssp_slq, yytext); return WORD;}
 \"                                    return QUOTE;
 \(                                    return OBRACE;
 \)                                    return CBRACE;
@@ -28,5 +39,6 @@ true                                  {yylval.bval = true; return BOOL;}
 \<                                    return LT;
 \>                                    return GT;
 \,                                    return COMMA;
+{UANY}+                               {yylval.sval = talloc_strdup(SLQ_VAR, yytext); return WORD;}
 [ \t\n]                               /* ignore */
 %%