aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-05-25 16:18:10 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-05-30 17:15:54 +0200
commitc234b5ee69186ec8dc02e3742d055ff24f0afba6 (patch)
treed8a90879dd72f689cfa0c1db6a8d2b37c024ac16 /src/bin/eolian
parenteolian: more expr system unit updates (diff)
downloadefl-c234b5ee69186ec8dc02e3742d055ff24f0afba6.tar.gz
eolian: expr eval APIs now take units
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/sources.c26
-rw-r--r--src/bin/eolian/types.c8
2 files changed, 17 insertions, 17 deletions
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index d58a702ef6..6eb6ad7927 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -69,12 +69,12 @@ _type_exists(const char *tname, Eina_Strbuf *buf)
}
static void
-_append_defval(Eina_Strbuf *buf, const Eolian_Expression *exp,
- const Eolian_Type *tp)
+_append_defval(const Eolian_Unit *src, Eina_Strbuf *buf,
+ const Eolian_Expression *exp, const Eolian_Type *tp)
{
if (exp)
{
- Eolian_Value val = eolian_expression_eval_type(exp, tp);
+ Eolian_Value val = eolian_expression_eval_type(src, exp, tp);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
if (lit)
{
@@ -115,9 +115,9 @@ _append_defval(Eina_Strbuf *buf, const Eolian_Expression *exp,
}
static void
-_gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
- Eolian_Function_Type ftype, Eina_Strbuf *buf,
- const Eolian_Implement *impl, Eina_Strbuf *lbuf)
+_gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
+ const Eolian_Function *fid, Eolian_Function_Type ftype,
+ Eina_Strbuf *buf, const Eolian_Implement *impl, Eina_Strbuf *lbuf)
{
Eina_Bool is_empty = eolian_implement_is_empty(impl, ftype);
Eina_Bool is_auto = eolian_implement_is_auto(impl, ftype);
@@ -248,7 +248,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
}
else if ((ftype != EOLIAN_PROP_SET) && dfv)
{
- Eolian_Value val = eolian_expression_eval(dfv, EOLIAN_MASK_ALL);
+ Eolian_Value val = eolian_expression_eval(src, dfv, EOLIAN_MASK_ALL);
if (val.type)
{
Eina_Stringshare *vals = eolian_expression_value_to_literal(&val);
@@ -359,7 +359,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
if (rtp)
{
eina_strbuf_append(buf, " return ");
- _append_defval(buf, def_ret, rtp);
+ _append_defval(src, buf, def_ret, rtp);
eina_strbuf_append(buf, ";\n");
}
eina_strbuf_append(buf, "}\n\n");
@@ -420,7 +420,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
if (strcmp(rtpn, "void"))
{
eina_strbuf_append_printf(buf, ", %s, ", rtpn);
- _append_defval(buf, def_ret, rtp);
+ _append_defval(src, buf, def_ret, rtp);
}
if (has_params)
{
@@ -682,14 +682,14 @@ eo_gen_source_gen(const Eolian_Unit *src,
{
case EOLIAN_PROP_GET:
case EOLIAN_PROP_SET:
- _gen_func(cl, fid, ftype, buf, imp, lbuf);
+ _gen_func(src, cl, fid, ftype, buf, imp, lbuf);
break;
case EOLIAN_PROPERTY:
- _gen_func(cl, fid, EOLIAN_PROP_SET, buf, imp, lbuf);
- _gen_func(cl, fid, EOLIAN_PROP_GET, buf, imp, lbuf);
+ _gen_func(src, cl, fid, EOLIAN_PROP_SET, buf, imp, lbuf);
+ _gen_func(src, cl, fid, EOLIAN_PROP_GET, buf, imp, lbuf);
break;
default:
- _gen_func(cl, fid, EOLIAN_METHOD, buf, imp, lbuf);
+ _gen_func(src, cl, fid, EOLIAN_METHOD, buf, imp, lbuf);
}
}
eina_iterator_free(itr);
diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c
index bd928dc268..8db220bd1d 100644
--- a/src/bin/eolian/types.c
+++ b/src/bin/eolian/types.c
@@ -97,7 +97,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
else
{
Eolian_Value val =
- eolian_expression_eval(vale, EOLIAN_MASK_INT);
+ eolian_expression_eval(src, vale, EOLIAN_MASK_INT);
const char *lit = eolian_expression_value_to_literal(&val);
eina_strbuf_append_printf(buf, " %s = %s", membn, lit);
const char *exp = eolian_expression_serialize(vale);
@@ -164,7 +164,7 @@ _var_generate(const Eolian_Unit *src, const Eolian_Variable *vr, Eina_Bool legac
eina_strbuf_prepend_printf(buf, "#ifndef %s\n", fn);
eina_strbuf_append_printf(buf, "#define %s ", fn);
const Eolian_Expression *vv = eolian_variable_value_get(vr);
- Eolian_Value val = eolian_expression_eval_type(vv, vt);
+ Eolian_Value val = eolian_expression_eval_type(src, vv, vt);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
eina_strbuf_append(buf, lit);
Eina_Stringshare *exp = eolian_expression_serialize(vv);
@@ -239,7 +239,7 @@ void eo_gen_types_header_gen(const Eolian_Unit *src,
}
}
-void eo_gen_types_source_gen(const Eolian_Unit *src EINA_UNUSED,
+void eo_gen_types_source_gen(const Eolian_Unit *src,
const char *eof, Eina_Strbuf *buf)
{
const Eolian_Declaration *decl;
@@ -274,7 +274,7 @@ void eo_gen_types_source_gen(const Eolian_Unit *src EINA_UNUSED,
eina_stringshare_del(ct);
free(fn);
- Eolian_Value val = eolian_expression_eval_type(vv, vt);
+ Eolian_Value val = eolian_expression_eval_type(src, vv, vt);
Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
eina_strbuf_append(buf, lit);
eina_strbuf_append_char(buf, ';');