From b613d6f1d98a511daf6524778ccadf8fadf75e3d Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Mon, 23 May 2016 15:58:11 -0300 Subject: [PATCH] eolian: Allow promises to have a second type Promises can have a second type, which is the progress type --- src/lib/eolian/eo_parser.c | 6 ++++++ src/tests/eolian/eolian_generated_promise.c | 5 +++++ src/tests/eolian/generated_promise.eo | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 10368bc..6e3d895 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -799,6 +799,12 @@ parse_type_void(Eo_Lexer *ls) parse_type(ls)); pop_type(ls); } + else if(tpid == KW_promise && test_next(ls, ',')) + { + def->subtypes = eina_list_append(def->subtypes, + parse_type(ls)); + pop_type(ls); + } check_match(ls, '>', '<', bline, bcol); } } diff --git a/src/tests/eolian/eolian_generated_promise.c b/src/tests/eolian/eolian_generated_promise.c index 2d0e6f6..4432600 100644 --- a/src/tests/eolian/eolian_generated_promise.c +++ b/src/tests/eolian/eolian_generated_promise.c @@ -11,6 +11,11 @@ struct Generated_Promise_Data {}; typedef struct Generated_Promise_Data Generated_Promise_Data; +static void _generated_promise_method_progress_type(Eo *obj EINA_UNUSED, Generated_Promise_Data *pd EINA_UNUSED, + Eina_Promise_Owner *promise1 EINA_UNUSED) +{ +} + static Eina_Promise * _generated_promise_prop1_get(Eo *obj EINA_UNUSED, Generated_Promise_Data *pd EINA_UNUSED) { return NULL; diff --git a/src/tests/eolian/generated_promise.eo b/src/tests/eolian/generated_promise.eo index c096a30..5363da0 100644 --- a/src/tests/eolian/generated_promise.eo +++ b/src/tests/eolian/generated_promise.eo @@ -6,6 +6,11 @@ class Generated_Promise (Eo.Base) @inout promise1: promise; } } + method_progress_type { + params { + @inout promise1: promise; + } + } method_multiple_args_1 { params { @inout promise1: promise; -- 2.7.4