q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4a16e1d86253ce336464f26ee9244f25511cb8bb
commit 4a16e1d86253ce336464f26ee9244f25511cb8bb Author: Daniel Kolesa <d.kol...@osg.samsung.com> Date: Wed Aug 30 16:02:30 2017 +0200 eolian: @extern for function pointers --- src/lib/eolian/eo_parser.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 7e40cb7d47..24585977c0 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -1383,7 +1383,9 @@ end: static Eolian_Typedecl* parse_function_pointer(Eo_Lexer *ls) { - int line, col; + int bline, bcol; + int line = ls->line_number, col = ls->column; + Eolian_Typedecl *def = push_typedecl(ls); Eina_Strbuf *buf = push_strbuf(ls); Eolian_Function *meth = NULL; @@ -1394,13 +1396,13 @@ parse_function_pointer(Eo_Lexer *ls) has_beta = EINA_FALSE; eo_lexer_get(ls); - parse_name(ls, buf); def->type = EOLIAN_TYPEDECL_FUNCTION_POINTER; - def->is_extern = EINA_FALSE; - - FILL_BASE(def->base, ls, ls->line_number, ls->column); + def->is_extern = (ls->t.kw == KW_at_extern); + if (def->is_extern) + eo_lexer_get(ls); + parse_name(ls, buf); _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)), &def->full_name, &def->name, &def->namespaces); @@ -1411,7 +1413,6 @@ parse_function_pointer(Eo_Lexer *ls) meth->type = EOLIAN_FUNCTION_POINTER; meth->get_scope = meth->set_scope = EOLIAN_SCOPE_PUBLIC; meth->name = eina_stringshare_ref(def->name); - FILL_BASE(meth->base, ls, ls->line_number, ls->column); def->function_pointer = meth; @@ -1431,8 +1432,8 @@ parse_function_pointer(Eo_Lexer *ls) goto body; } body: - line = ls->line_number; - col = ls->column; + bline = ls->line_number; + bcol = ls->column; check_next(ls, '{'); FILL_DOC(ls, def, doc); for (;;) switch (ls->t.kw) @@ -1455,8 +1456,10 @@ body: goto end; } end: - check_match(ls, '}', '{', line, col); + check_match(ls, '}', '{', bline, bcol); check_next(ls, ';'); + FILL_BASE(def->base, ls, line, col); + FILL_BASE(meth->base, ls, line, col); return def; } --