summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9935ca9)
raw | patch | inline | side by side (parent: 9935ca9)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 1 Dec 2014 16:36:29 +0000 (17:36 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 1 Dec 2014 16:36:29 +0000 (17:36 +0100) |
… where <obj_expression> may be an arbitrary expression accessing an object's
fields or attributes.
fields or attributes.
src/frontend/grammar.y | patch | blob | history |
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index 2872bcf447fdeacb561aae754b9c85420a3fddc7..187f3599c08e2514596bd5046d653c8f03c26842 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
%type <m> matcher
compare_matcher
-%type <expr> expression
+%type <expr> expression object_expression
%type <integer> object_type object_type_plural
%type <integer> iterable
sdb_object_deref(SDB_OBJ($3)); $3 = NULL;
}
|
+ object_expression
+ {
+ $$ = $1;
+ }
+ |
+ data
+ {
+ $$ = sdb_store_expr_constvalue(&$1);
+ sdb_data_free_datum(&$1);
+ }
+ ;
+
+object_expression:
+ object_type '.' object_expression
+ {
+ $$ = sdb_store_expr_typed($1, $3);
+ sdb_object_deref(SDB_OBJ($3));
+ }
+ |
field
{
$$ = sdb_store_expr_fieldvalue($1);
$$ = sdb_store_expr_attrvalue($3);
free($3); $3 = NULL;
}
- |
- data
- {
- $$ = sdb_store_expr_constvalue(&$1);
- sdb_data_free_datum(&$1);
- }
;
object_type: