summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-23 15:58:11 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-23 15:58:11 -0300
commitb613d6f1d98a511daf6524778ccadf8fadf75e3d (patch)
tree020b0bb152d776be40b1398083e86ad9dedbee49
parente3c8b280c639058c54f5576f189d0dc288105fc7 (diff)
eolian: Allow promises to have a second type
Promises can have a second type, which is the progress type
-rw-r--r--src/lib/eolian/eo_parser.c6
-rw-r--r--src/tests/eolian/eolian_generated_promise.c5
-rw-r--r--src/tests/eolian/generated_promise.eo5
3 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 10368bcba6..6e3d895e26 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)
799 parse_type(ls)); 799 parse_type(ls));
800 pop_type(ls); 800 pop_type(ls);
801 } 801 }
802 else if(tpid == KW_promise && test_next(ls, ','))
803 {
804 def->subtypes = eina_list_append(def->subtypes,
805 parse_type(ls));
806 pop_type(ls);
807 }
802 check_match(ls, '>', '<', bline, bcol); 808 check_match(ls, '>', '<', bline, bcol);
803 } 809 }
804 } 810 }
diff --git a/src/tests/eolian/eolian_generated_promise.c b/src/tests/eolian/eolian_generated_promise.c
index 2d0e6f659e..44326006c6 100644
--- a/src/tests/eolian/eolian_generated_promise.c
+++ b/src/tests/eolian/eolian_generated_promise.c
@@ -11,6 +11,11 @@
11struct Generated_Promise_Data {}; 11struct Generated_Promise_Data {};
12typedef struct Generated_Promise_Data Generated_Promise_Data; 12typedef struct Generated_Promise_Data Generated_Promise_Data;
13 13
14static void _generated_promise_method_progress_type(Eo *obj EINA_UNUSED, Generated_Promise_Data *pd EINA_UNUSED,
15 Eina_Promise_Owner *promise1 EINA_UNUSED)
16{
17}
18
14static Eina_Promise * _generated_promise_prop1_get(Eo *obj EINA_UNUSED, Generated_Promise_Data *pd EINA_UNUSED) 19static Eina_Promise * _generated_promise_prop1_get(Eo *obj EINA_UNUSED, Generated_Promise_Data *pd EINA_UNUSED)
15{ 20{
16 return NULL; 21 return NULL;
diff --git a/src/tests/eolian/generated_promise.eo b/src/tests/eolian/generated_promise.eo
index c096a309da..5363da023c 100644
--- a/src/tests/eolian/generated_promise.eo
+++ b/src/tests/eolian/generated_promise.eo
@@ -6,6 +6,11 @@ class Generated_Promise (Eo.Base)
6 @inout promise1: promise<int>; 6 @inout promise1: promise<int>;
7 } 7 }
8 } 8 }
9 method_progress_type {
10 params {
11 @inout promise1: promise<int, double>;
12 }
13 }
9 method_multiple_args_1 { 14 method_multiple_args_1 {
10 params { 15 params {
11 @inout promise1: promise<int>; 16 @inout promise1: promise<int>;