summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2015-02-18 15:41:50 +0000
committerDaniel Kolesa <d.kolesa@samsung.com>2015-02-18 15:41:50 +0000
commit42912e6e440a860fe92009c126c92851fa058a5b (patch)
treecfeb5e1ab27d5f09b4898848f3fe7323f77f439d
parentfd0de9ae5c19dd333ec28b0c1712be76b2d68097 (diff)
eolian: convenience macro to fill base structures in parser
-rw-r--r--src/lib/eolian/eo_parser.c125
1 files changed, 35 insertions, 90 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 67047559ed..8c21a3fdf8 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -9,6 +9,11 @@
9 eo_lexer_syntax_error(ls, "double " msg); \ 9 eo_lexer_syntax_error(ls, "double " msg); \
10 has_##var = EINA_TRUE; 10 has_##var = EINA_TRUE;
11 11
12#define FILL_BASE(exp, ls, l, c) \
13 (exp).file = eina_stringshare_ref(ls->filename); \
14 (exp).line = l; \
15 (exp).column = c;
16
12static void 17static void
13error_expected(Eo_Lexer *ls, int token) 18error_expected(Eo_Lexer *ls, int token)
14{ 19{
@@ -316,9 +321,7 @@ parse_expr_simple(Eo_Lexer *ls)
316 Eolian_Expression *exp = parse_expr_bin(ls, UNARY_PRECEDENCE); 321 Eolian_Expression *exp = parse_expr_bin(ls, UNARY_PRECEDENCE);
317 pop_expr(ls); 322 pop_expr(ls);
318 expr = push_expr(ls); 323 expr = push_expr(ls);
319 expr->base.file = eina_stringshare_ref(ls->filename); 324 FILL_BASE(expr->base, ls, line, col);
320 expr->base.line = line;
321 expr->base.column = col;
322 expr->unop = unop; 325 expr->unop = unop;
323 expr->type = EOLIAN_EXPR_UNARY; 326 expr->type = EOLIAN_EXPR_UNARY;
324 expr->expr = exp; 327 expr->expr = exp;
@@ -330,9 +333,7 @@ parse_expr_simple(Eo_Lexer *ls)
330 { 333 {
331 int line = ls->line_number, col = ls->column; 334 int line = ls->line_number, col = ls->column;
332 expr = push_expr(ls); 335 expr = push_expr(ls);
333 expr->base.file = eina_stringshare_ref(ls->filename); 336 FILL_BASE(expr->base, ls, line, col);
334 expr->base.line = line;
335 expr->base.column = col;
336 expr->type = ls->t.kw + 1; /* map Numbers from lexer to expr type */ 337 expr->type = ls->t.kw + 1; /* map Numbers from lexer to expr type */
337 expr->value = ls->t.value; 338 expr->value = ls->t.value;
338 eo_lexer_get(ls); 339 eo_lexer_get(ls);
@@ -342,9 +343,7 @@ parse_expr_simple(Eo_Lexer *ls)
342 { 343 {
343 int line = ls->line_number, col = ls->column; 344 int line = ls->line_number, col = ls->column;
344 expr = push_expr(ls); 345 expr = push_expr(ls);
345 expr->base.file = eina_stringshare_ref(ls->filename); 346 FILL_BASE(expr->base, ls, line, col);
346 expr->base.line = line;
347 expr->base.column = col;
348 expr->type = EOLIAN_EXPR_STRING; 347 expr->type = EOLIAN_EXPR_STRING;
349 expr->value.s = eina_stringshare_ref(ls->t.value.s); 348 expr->value.s = eina_stringshare_ref(ls->t.value.s);
350 eo_lexer_get(ls); 349 eo_lexer_get(ls);
@@ -354,9 +353,7 @@ parse_expr_simple(Eo_Lexer *ls)
354 { 353 {
355 int line = ls->line_number, col = ls->column; 354 int line = ls->line_number, col = ls->column;
356 expr = push_expr(ls); 355 expr = push_expr(ls);
357 expr->base.file = eina_stringshare_ref(ls->filename); 356 FILL_BASE(expr->base, ls, line, col);
358 expr->base.line = line;
359 expr->base.column = col;
360 expr->type = EOLIAN_EXPR_CHAR; 357 expr->type = EOLIAN_EXPR_CHAR;
361 expr->value.c = ls->t.value.c; 358 expr->value.c = ls->t.value.c;
362 eo_lexer_get(ls); 359 eo_lexer_get(ls);
@@ -402,9 +399,7 @@ parse_expr_simple(Eo_Lexer *ls)
402 break; 399 break;
403 } 400 }
404 } 401 }
405 expr->base.file = eina_stringshare_ref(ls->filename); 402 FILL_BASE(expr->base, ls, line, col);
406 expr->base.line = line;
407 expr->base.column = col;
408 break; 403 break;
409 } 404 }
410 case '(': 405 case '(':
@@ -441,9 +436,7 @@ parse_expr_bin(Eo_Lexer *ls, int min_prec)
441 pop_expr(ls); 436 pop_expr(ls);
442 pop_expr(ls); 437 pop_expr(ls);
443 bin = push_expr(ls); 438 bin = push_expr(ls);
444 bin->base.file = eina_stringshare_ref(ls->filename); 439 FILL_BASE(bin->base, ls, line, col);
445 bin->base.line = line;
446 bin->base.column = col;
447 bin->binop = op; 440 bin->binop = op;
448 bin->type = EOLIAN_EXPR_BINARY; 441 bin->type = EOLIAN_EXPR_BINARY;
449 bin->lhs = lhs; 442 bin->lhs = lhs;
@@ -536,9 +529,7 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
536 eo_lexer_get(ls); 529 eo_lexer_get(ls);
537 check_next(ls, ':'); 530 check_next(ls, ':');
538 tp = parse_type(ls); 531 tp = parse_type(ls);
539 fdef->base.file = eina_stringshare_ref(ls->filename); 532 FILL_BASE(fdef->base, ls, fline, fcol);
540 fdef->base.line = fline;
541 fdef->base.column = fcol;
542 fdef->type = tp; 533 fdef->type = tp;
543 fdef->name = eina_stringshare_ref(fname); 534 fdef->name = eina_stringshare_ref(fname);
544 pop_type(ls); 535 pop_type(ls);
@@ -550,9 +541,7 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
550 } 541 }
551 } 542 }
552 check_match(ls, '}', '{', bline, bcolumn); 543 check_match(ls, '}', '{', bline, bcolumn);
553 def->base.file = eina_stringshare_ref(ls->filename); 544 FILL_BASE(def->base, ls, line, column);
554 def->base.line = line;
555 def->base.column = column;
556 if (name) database_struct_add(def); 545 if (name) database_struct_add(def);
557 return def; 546 return def;
558} 547}
@@ -611,18 +600,14 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
611 eina_hash_add(def->fields, fname, fdef); 600 eina_hash_add(def->fields, fname, fdef);
612 def->field_list = eina_list_append(def->field_list, fdef); 601 def->field_list = eina_list_append(def->field_list, fdef);
613 eo_lexer_get(ls); 602 eo_lexer_get(ls);
614 fdef->base.file = eina_stringshare_ref(ls->filename); 603 FILL_BASE(fdef->base, ls, fline, fcol);
615 fdef->base.line = fline;
616 fdef->base.column = fcol;
617 fdef->name = eina_stringshare_ref(fname); 604 fdef->name = eina_stringshare_ref(fname);
618 if (ls->t.token != '=') 605 if (ls->t.token != '=')
619 { 606 {
620 if (!prev_exp) 607 if (!prev_exp)
621 { 608 {
622 prev_exp = push_expr(ls); 609 prev_exp = push_expr(ls);
623 prev_exp->base.file = eina_stringshare_ref(ls->filename); 610 FILL_BASE(prev_exp->base, ls, -1, -1);
624 prev_exp->base.line = -1;
625 prev_exp->base.column = -1;
626 prev_exp->type = EOLIAN_EXPR_INT; 611 prev_exp->type = EOLIAN_EXPR_INT;
627 prev_exp->value.i = 0; 612 prev_exp->value.i = 0;
628 fdef->value = prev_exp; 613 fdef->value = prev_exp;
@@ -651,9 +636,7 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
651 break; 636 break;
652 } 637 }
653 check_match(ls, '}', '{', bline, bcolumn); 638 check_match(ls, '}', '{', bline, bcolumn);
654 def->base.file = eina_stringshare_ref(ls->filename); 639 FILL_BASE(def->base, ls, line, column);
655 def->base.line = line;
656 def->base.column = column;
657 if (name) database_enum_add(def); 640 if (name) database_enum_add(def);
658 return def; 641 return def;
659} 642}
@@ -704,9 +687,7 @@ static void
704_append_dep(Eo_Lexer *ls, const char *fname, const char *name, int line, int col) 687_append_dep(Eo_Lexer *ls, const char *fname, const char *name, int line, int col)
705{ 688{
706 Eolian_Dependency *dep = calloc(1, sizeof(Eolian_Dependency)); 689 Eolian_Dependency *dep = calloc(1, sizeof(Eolian_Dependency));
707 dep->base.file = eina_stringshare_ref(ls->filename); 690 FILL_BASE(dep->base, ls, line, col);
708 dep->base.line = line;
709 dep->base.column = col;
710 dep->filename = eina_stringshare_add(fname); 691 dep->filename = eina_stringshare_add(fname);
711 dep->name = eina_stringshare_add(name); 692 dep->name = eina_stringshare_add(name);
712 eina_hash_set(_depclasses, ls->filename, eina_list_append((Eina_List*) 693 eina_hash_set(_depclasses, ls->filename, eina_list_append((Eina_List*)
@@ -731,9 +712,7 @@ parse_type_named_void(Eo_Lexer *ls, Eina_Bool allow_named)
731 pcol = ls->column; 712 pcol = ls->column;
732 check_next(ls, '('); 713 check_next(ls, '(');
733 def = parse_type_void(ls); 714 def = parse_type_void(ls);
734 def->base.file = eina_stringshare_ref(ls->filename); 715 FILL_BASE(def->base, ls, line, col);
735 def->base.line = line;
736 def->base.column = col;
737 def->is_const = EINA_TRUE; 716 def->is_const = EINA_TRUE;
738 check_match(ls, ')', '(', pline, pcol); 717 check_match(ls, ')', '(', pline, pcol);
739 goto parse_ptr; 718 goto parse_ptr;
@@ -753,9 +732,7 @@ parse_type_named_void(Eo_Lexer *ls, Eina_Bool allow_named)
753 eo_lexer_syntax_error(ls, "pointer type expected"); 732 eo_lexer_syntax_error(ls, "pointer type expected");
754 } 733 }
755 eo_lexer_context_pop(ls); 734 eo_lexer_context_pop(ls);
756 def->base.file = eina_stringshare_ref(ls->filename); 735 FILL_BASE(def->base, ls, line, col);
757 def->base.line = line;
758 def->base.column = col;
759 def->is_own = EINA_TRUE; 736 def->is_own = EINA_TRUE;
760 check_match(ls, ')', '(', pline, pcolumn); 737 check_match(ls, ')', '(', pline, pcolumn);
761 goto parse_ptr; 738 goto parse_ptr;
@@ -779,9 +756,7 @@ parse_type_named_void(Eo_Lexer *ls, Eina_Bool allow_named)
779 check(ls, TOK_VALUE); 756 check(ls, TOK_VALUE);
780 def->freefunc = eina_stringshare_ref(ls->t.value.s); 757 def->freefunc = eina_stringshare_ref(ls->t.value.s);
781 eo_lexer_get(ls); 758 eo_lexer_get(ls);
782 def->base.file = eina_stringshare_ref(ls->filename); 759 FILL_BASE(def->base, ls, line, col);
783 def->base.line = line;
784 def->base.column = col;
785 check_match(ls, ')', '(', pline, pcolumn); 760 check_match(ls, ')', '(', pline, pcolumn);
786 goto parse_ptr; 761 goto parse_ptr;
787 } 762 }
@@ -831,9 +806,7 @@ parse_type_named_void(Eo_Lexer *ls, Eina_Bool allow_named)
831 def = push_type(ls); 806 def = push_type(ls);
832 def->type = is_enum ? EOLIAN_TYPE_REGULAR_ENUM 807 def->type = is_enum ? EOLIAN_TYPE_REGULAR_ENUM
833 : EOLIAN_TYPE_REGULAR_STRUCT; 808 : EOLIAN_TYPE_REGULAR_STRUCT;
834 def->base.file = eina_stringshare_ref(ls->filename); 809 FILL_BASE(def->base, ls, line, col);
835 def->base.line = line;
836 def->base.column = col;
837 pop_str(ls); 810 pop_str(ls);
838 _fill_name(sname, &def->full_name, &def->name, &def->namespaces); 811 _fill_name(sname, &def->full_name, &def->name, &def->namespaces);
839 goto parse_ptr; 812 goto parse_ptr;
@@ -842,9 +815,7 @@ parse_type_named_void(Eo_Lexer *ls, Eina_Bool allow_named)
842 break; 815 break;
843 } 816 }
844 def = push_type(ls); 817 def = push_type(ls);
845 def->base.file = eina_stringshare_ref(ls->filename); 818 FILL_BASE(def->base, ls, line, col);
846 def->base.line = line;
847 def->base.column = col;
848 if (ls->t.kw == KW_void) 819 if (ls->t.kw == KW_void)
849 { 820 {
850 def->type = EOLIAN_TYPE_VOID; 821 def->type = EOLIAN_TYPE_VOID;
@@ -921,9 +892,7 @@ parse_ptr:
921 Eolian_Type *pdef; 892 Eolian_Type *pdef;
922 pop_type(ls); 893 pop_type(ls);
923 pdef = push_type(ls); 894 pdef = push_type(ls);
924 pdef->base.file = eina_stringshare_ref(ls->filename); 895 FILL_BASE(pdef->base, ls, ls->line_number, ls->column);
925 pdef->base.line = ls->line_number;
926 pdef->base.column = ls->column;
927 pdef->base_type = def; 896 pdef->base_type = def;
928 pdef->type = EOLIAN_TYPE_POINTER; 897 pdef->type = EOLIAN_TYPE_POINTER;
929 def = pdef; 898 def = pdef;
@@ -953,9 +922,7 @@ parse_typedef(Eo_Lexer *ls)
953 def->is_extern = has_extern; 922 def->is_extern = has_extern;
954 buf = push_strbuf(ls); 923 buf = push_strbuf(ls);
955 eo_lexer_context_push(ls); 924 eo_lexer_context_push(ls);
956 def->base.file = eina_stringshare_ref(ls->filename); 925 FILL_BASE(def->base, ls, ls->line_number, ls->column);
957 def->base.line = ls->line_number;
958 def->base.column = ls->column;
959 parse_name(ls, buf); 926 parse_name(ls, buf);
960 _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)), 927 _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)),
961 &def->full_name, &def->name, &def->namespaces); 928 &def->full_name, &def->name, &def->namespaces);
@@ -997,9 +964,7 @@ parse_variable(Eo_Lexer *ls, Eina_Bool global)
997 def->is_extern = has_extern; 964 def->is_extern = has_extern;
998 buf = push_strbuf(ls); 965 buf = push_strbuf(ls);
999 eo_lexer_context_push(ls); 966 eo_lexer_context_push(ls);
1000 def->base.file = eina_stringshare_ref(ls->filename); 967 FILL_BASE(def->base, ls, ls->line_number, ls->column);
1001 def->base.line = ls->line_number;
1002 def->base.column = ls->column;
1003 parse_name(ls, buf); 968 parse_name(ls, buf);
1004 _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)), 969 _fill_name(eina_stringshare_add(eina_strbuf_string_get(buf)),
1005 &def->full_name, &def->name, &def->namespaces); 970 &def->full_name, &def->name, &def->namespaces);
@@ -1072,9 +1037,7 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
1072 Eina_Bool has_nonull = EINA_FALSE, has_optional = EINA_FALSE, 1037 Eina_Bool has_nonull = EINA_FALSE, has_optional = EINA_FALSE,
1073 has_nullable = EINA_FALSE; 1038 has_nullable = EINA_FALSE;
1074 Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter)); 1039 Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter));
1075 par->base.file = eina_stringshare_ref(ls->filename); 1040 FILL_BASE(par->base, ls, ls->line_number, ls->column);
1076 par->base.line = ls->line_number;
1077 par->base.column = ls->column;
1078 *params = eina_list_append(*params, par); 1041 *params = eina_list_append(*params, par);
1079 if (allow_inout) 1042 if (allow_inout)
1080 { 1043 {
@@ -1183,9 +1146,7 @@ parse_accessor(Eo_Lexer *ls, Eolian_Function *prop)
1183 { 1146 {
1184 if (prop->base.file) 1147 if (prop->base.file)
1185 eina_stringshare_del(prop->base.file); 1148 eina_stringshare_del(prop->base.file);
1186 prop->base.file = eina_stringshare_ref(ls->filename); 1149 FILL_BASE(prop->base, ls, ls->line_number, ls->column);
1187 prop->base.line = ls->line_number;
1188 prop->base.column = ls->column;
1189 if (prop->type == EOLIAN_PROP_SET) 1150 if (prop->type == EOLIAN_PROP_SET)
1190 prop->type = EOLIAN_PROPERTY; 1151 prop->type = EOLIAN_PROPERTY;
1191 else 1152 else
@@ -1193,9 +1154,7 @@ parse_accessor(Eo_Lexer *ls, Eolian_Function *prop)
1193 } 1154 }
1194 else 1155 else
1195 { 1156 {
1196 prop->set_base.file = eina_stringshare_ref(ls->filename); 1157 FILL_BASE(prop->set_base, ls, ls->line_number, ls->column);
1197 prop->set_base.line = ls->line_number;
1198 prop->set_base.column = ls->column;
1199 if (prop->type == EOLIAN_PROP_GET) 1158 if (prop->type == EOLIAN_PROP_GET)
1200 prop->type = EOLIAN_PROPERTY; 1159 prop->type = EOLIAN_PROPERTY;
1201 else 1160 else
@@ -1300,9 +1259,7 @@ parse_property(Eo_Lexer *ls)
1300 prop = calloc(1, sizeof(Eolian_Function)); 1259 prop = calloc(1, sizeof(Eolian_Function));
1301 prop->klass = ls->tmp.kls; 1260 prop->klass = ls->tmp.kls;
1302 prop->type = EOLIAN_UNRESOLVED; 1261 prop->type = EOLIAN_UNRESOLVED;
1303 prop->base.file = eina_stringshare_ref(ls->filename); 1262 FILL_BASE(prop->base, ls, ls->line_number, ls->column);
1304 prop->base.line = ls->line_number;
1305 prop->base.column = ls->column;
1306 ls->tmp.kls->properties = eina_list_append(ls->tmp.kls->properties, prop); 1263 ls->tmp.kls->properties = eina_list_append(ls->tmp.kls->properties, prop);
1307 check(ls, TOK_VALUE); 1264 check(ls, TOK_VALUE);
1308 prop->name = eina_stringshare_ref(ls->t.value.s); 1265 prop->name = eina_stringshare_ref(ls->t.value.s);
@@ -1376,9 +1333,7 @@ parse_method(Eo_Lexer *ls)
1376 meth = calloc(1, sizeof(Eolian_Function)); 1333 meth = calloc(1, sizeof(Eolian_Function));
1377 meth->klass = ls->tmp.kls; 1334 meth->klass = ls->tmp.kls;
1378 meth->type = EOLIAN_METHOD; 1335 meth->type = EOLIAN_METHOD;
1379 meth->base.file = eina_stringshare_ref(ls->filename); 1336 FILL_BASE(meth->base, ls, ls->line_number, ls->column);
1380 meth->base.line = ls->line_number;
1381 meth->base.column = ls->column;
1382 ls->tmp.kls->methods = eina_list_append(ls->tmp.kls->methods, meth); 1337 ls->tmp.kls->methods = eina_list_append(ls->tmp.kls->methods, meth);
1383 check(ls, TOK_VALUE); 1338 check(ls, TOK_VALUE);
1384 meth->name = eina_stringshare_ref(ls->t.value.s); 1339 meth->name = eina_stringshare_ref(ls->t.value.s);
@@ -1480,9 +1435,7 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface)
1480 return; 1435 return;
1481 } 1436 }
1482 impl = calloc(1, sizeof(Eolian_Implement)); 1437 impl = calloc(1, sizeof(Eolian_Implement));
1483 impl->base.file = eina_stringshare_ref(ls->filename); 1438 FILL_BASE(impl->base, ls, iline, icol);
1484 impl->base.line = iline;
1485 impl->base.column = icol;
1486 ls->tmp.kls->implements = eina_list_append(ls->tmp.kls->implements, impl); 1439 ls->tmp.kls->implements = eina_list_append(ls->tmp.kls->implements, impl);
1487 switch (ls->t.kw) 1440 switch (ls->t.kw)
1488 { 1441 {
@@ -1579,9 +1532,7 @@ parse_constructor(Eo_Lexer *ls)
1579 Eina_Strbuf *buf = NULL; 1532 Eina_Strbuf *buf = NULL;
1580 Eolian_Constructor *ctor = NULL; 1533 Eolian_Constructor *ctor = NULL;
1581 ctor = calloc(1, sizeof(Eolian_Constructor)); 1534 ctor = calloc(1, sizeof(Eolian_Constructor));
1582 ctor->base.file = eina_stringshare_ref(ls->filename); 1535 FILL_BASE(ctor->base, ls, ls->line_number, ls->column);
1583 ctor->base.line = ls->line_number;
1584 ctor->base.column = ls->column;
1585 ls->tmp.kls->constructors = eina_list_append(ls->tmp.kls->constructors, ctor); 1536 ls->tmp.kls->constructors = eina_list_append(ls->tmp.kls->constructors, ctor);
1586 if (ls->t.token == '.') 1537 if (ls->t.token == '.')
1587 { 1538 {
@@ -1629,9 +1580,7 @@ static void
1629parse_event(Eo_Lexer *ls) 1580parse_event(Eo_Lexer *ls)
1630{ 1581{
1631 Eolian_Event *ev = calloc(1, sizeof(Eolian_Event)); 1582 Eolian_Event *ev = calloc(1, sizeof(Eolian_Event));
1632 ev->base.file = eina_stringshare_ref(ls->filename); 1583 FILL_BASE(ev->base, ls, ls->line_number, ls->column);
1633 ev->base.line = ls->line_number;
1634 ev->base.column = ls->column;
1635 Eina_Strbuf *buf = push_strbuf(ls); 1584 Eina_Strbuf *buf = push_strbuf(ls);
1636 ls->tmp.kls->events = eina_list_append(ls->tmp.kls->events, ev); 1585 ls->tmp.kls->events = eina_list_append(ls->tmp.kls->events, ev);
1637 check(ls, TOK_VALUE); 1586 check(ls, TOK_VALUE);
@@ -1821,9 +1770,7 @@ parse_class(Eo_Lexer *ls, Eolian_Class_Type type)
1821 int line, col; 1770 int line, col;
1822 Eina_Strbuf *buf = push_strbuf(ls); 1771 Eina_Strbuf *buf = push_strbuf(ls);
1823 ls->tmp.kls = calloc(1, sizeof(Eolian_Class)); 1772 ls->tmp.kls = calloc(1, sizeof(Eolian_Class));
1824 ls->tmp.kls->base.file = eina_stringshare_ref(ls->filename); 1773 FILL_BASE(ls->tmp.kls->base, ls, ls->line_number, ls->column);
1825 ls->tmp.kls->base.line = ls->line_number;
1826 ls->tmp.kls->base.column = ls->column;
1827 eo_lexer_get(ls); 1774 eo_lexer_get(ls);
1828 ls->tmp.kls->type = type; 1775 ls->tmp.kls->type = type;
1829 eo_lexer_context_push(ls); 1776 eo_lexer_context_push(ls);
@@ -1936,9 +1883,7 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
1936 def->comment = eina_stringshare_ref(ls->t.value.s); 1883 def->comment = eina_stringshare_ref(ls->t.value.s);
1937 eo_lexer_get(ls); 1884 eo_lexer_get(ls);
1938 } 1885 }
1939 def->base.file = eina_stringshare_ref(ls->filename); 1886 FILL_BASE(def->base, ls, line, col);
1940 def->base.line = line;
1941 def->base.column = col;
1942 database_struct_add(def); 1887 database_struct_add(def);
1943 pop_type(ls); 1888 pop_type(ls);
1944 break; 1889 break;