]> mj.ucw.cz Git - leo.git/blobdiff - css-parse.y
TODO
[leo.git] / css-parse.y
index 33293217ddad9f66feffc3f0cf64000a06f2310c..b9937bbaa409e2e1e3287463271cfa90ea284159 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Hic Est Leo -- MapCSS Parser
  *
- *     (c) 2014 Martin Mares <mj@ucw.cz>
+ *     (c) 2014--2015 Martin Mares <mj@ucw.cz>
  */
 
 %{
@@ -13,6 +13,7 @@
 
 #include "leo.h"
 #include "css.h"
+#include "expr.h"
 
 static void *css_alloc(size_t n)
 {
@@ -49,7 +50,7 @@ static void css_add_to_val_list(struct style_prop *list, struct style_prop *elt)
 
 %token LE GE NE CC
 %token SINGLE_PROP
-%token <s> NUMBER IDENT QUOTED RGB
+%token <s> NUMBER IDENT QUOTED RGB LUA
 
 %type <s> ident_or_quoted
 %type <rule> rule rule_start rule_selectors rule_start_actions rule_actions
@@ -237,9 +238,16 @@ action:
     ident_or_quoted ':' prop_value
       {
        $$ = css_alloc(sizeof(struct css_action));
+       $$->type = CSS_ACTION_SET;
        $$->prop = $3;
        $$->prop.key = style_prop_encode($1);
       }
+  | LUA
+      {
+       $$ = css_alloc(sizeof(struct css_action));
+       $$->type = CSS_ACTION_EXPR;
+       expr_compile($$, $1);
+      }
   ;
 
 prop_value: