summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-01-13 15:15:10 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-01-13 15:26:05 +0100
commita70645e154950140c8d3883a5bc99d3d259ff32a (patch)
tree0fb6b2d213a246579621093b03a5bab0c0225860
parent70ad68bfc76f897b89c8db19652aa9c6607d3eb0 (diff)
eolian: consistent and cleaner error values from APIs
Now all error/unknown/etc values returned from APIs are zero, previously it was a mix of zeroes and minus ones. Also, some enums that had no error/invalid value before have one now, which allows for better distinction between what is an error and what is an intended result.
-rw-r--r--src/bin/eolian/docs.c8
-rw-r--r--src/bindings/luajit/eolian.lua114
-rw-r--r--src/lib/eolian/Eolian.h14
-rw-r--r--src/lib/eolian/database_event_api.c2
-rw-r--r--src/lib/eolian/database_function_api.c14
-rw-r--r--src/lib/eolian/database_function_parameter_api.c2
-rw-r--r--src/lib/eolian/eo_parser.c23
-rw-r--r--src/lib/eolian/eolian_database.h2
-rw-r--r--src/scripts/elua/apps/docgen/doctree.lua5
9 files changed, 96 insertions, 88 deletions
diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c
index b8bffa9..0bfbe7f 100644
--- a/src/bin/eolian/docs.c
+++ b/src/bin/eolian/docs.c
@@ -573,10 +573,6 @@ eo_gen_docs_func_gen(const Eolian_Function *fid, Eolian_Function_Type ftype,
573 573
574 switch (dir) 574 switch (dir)
575 { 575 {
576 case EOLIAN_IN_PARAM:
577 eina_strbuf_append(buf, " * @param[in] ");
578 curl += sizeof(" * @param[in] ") - 1;
579 break;
580 case EOLIAN_OUT_PARAM: 576 case EOLIAN_OUT_PARAM:
581 eina_strbuf_append(buf, " * @param[out] "); 577 eina_strbuf_append(buf, " * @param[out] ");
582 curl += sizeof(" * @param[out] ") - 1; 578 curl += sizeof(" * @param[out] ") - 1;
@@ -585,6 +581,10 @@ eo_gen_docs_func_gen(const Eolian_Function *fid, Eolian_Function_Type ftype,
585 eina_strbuf_append(buf, " * @param[in,out] "); 581 eina_strbuf_append(buf, " * @param[in,out] ");
586 curl += sizeof(" * @param[in,out] ") - 1; 582 curl += sizeof(" * @param[in,out] ") - 1;
587 break; 583 break;
584 default:
585 eina_strbuf_append(buf, " * @param[in] ");
586 curl += sizeof(" * @param[in] ") - 1;
587 break;
588 } 588 }
589 589
590 const char *nm = eolian_parameter_name_get(par); 590 const char *nm = eolian_parameter_name_get(par);
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 409c94e..e9dc676 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -40,14 +40,15 @@ ffi.cdef [[
40 40
41 typedef enum 41 typedef enum
42 { 42 {
43 EOLIAN_IN_PARAM = 0, 43 EOLIAN_UNKNOWN_PARAM = 0,
44 EOLIAN_IN_PARAM,
44 EOLIAN_OUT_PARAM, 45 EOLIAN_OUT_PARAM,
45 EOLIAN_INOUT_PARAM 46 EOLIAN_INOUT_PARAM
46 } Eolian_Parameter_Dir; 47 } Eolian_Parameter_Dir;
47 48
48 typedef enum 49 typedef enum
49 { 50 {
50 EOLIAN_CLASS_UNKNOWN_TYPE = 0, 51 EOLIAN_CLASS_UNKNOWN_TYPE = 0,
51 EOLIAN_CLASS_REGULAR, 52 EOLIAN_CLASS_REGULAR,
52 EOLIAN_CLASS_ABSTRACT, 53 EOLIAN_CLASS_ABSTRACT,
53 EOLIAN_CLASS_MIXIN, 54 EOLIAN_CLASS_MIXIN,
@@ -56,7 +57,8 @@ ffi.cdef [[
56 57
57 typedef enum 58 typedef enum
58 { 59 {
59 EOLIAN_SCOPE_PUBLIC = 0, 60 EOLIAN_SCOPE_UNKNOWN = 0,
61 EOLIAN_SCOPE_PUBLIC,
60 EOLIAN_SCOPE_PRIVATE, 62 EOLIAN_SCOPE_PRIVATE,
61 EOLIAN_SCOPE_PROTECTED 63 EOLIAN_SCOPE_PROTECTED
62 } Eolian_Object_Scope; 64 } Eolian_Object_Scope;
@@ -142,7 +144,7 @@ ffi.cdef [[
142 } Eolian_Value_t; 144 } Eolian_Value_t;
143 145
144 typedef enum { 146 typedef enum {
145 EOLIAN_BINOP_INVALID = -1, 147 EOLIAN_BINOP_INVALID = 0,
146 148
147 EOLIAN_BINOP_ADD, /* + int, float */ 149 EOLIAN_BINOP_ADD, /* + int, float */
148 EOLIAN_BINOP_SUB, /* - int, float */ 150 EOLIAN_BINOP_SUB, /* - int, float */
@@ -168,7 +170,7 @@ ffi.cdef [[
168 } Eolian_Binary_Operator; 170 } Eolian_Binary_Operator;
169 171
170 typedef enum { 172 typedef enum {
171 EOLIAN_UNOP_INVALID = -1, 173 EOLIAN_UNOP_INVALID = 0,
172 174
173 EOLIAN_UNOP_UNM, /* - sint */ 175 EOLIAN_UNOP_UNM, /* - sint */
174 EOLIAN_UNOP_UNP, /* + sint */ 176 EOLIAN_UNOP_UNP, /* + sint */
@@ -178,7 +180,7 @@ ffi.cdef [[
178 } Eolian_Unary_Operator; 180 } Eolian_Unary_Operator;
179 181
180 typedef enum { 182 typedef enum {
181 EOLIAN_DECL_UNKNOWN = -1, 183 EOLIAN_DECL_UNKNOWN = 0,
182 EOLIAN_DECL_CLASS, 184 EOLIAN_DECL_CLASS,
183 EOLIAN_DECL_ALIAS, 185 EOLIAN_DECL_ALIAS,
184 EOLIAN_DECL_STRUCT, 186 EOLIAN_DECL_STRUCT,
@@ -187,7 +189,7 @@ ffi.cdef [[
187 } Eolian_Declaration_Type; 189 } Eolian_Declaration_Type;
188 190
189 typedef enum { 191 typedef enum {
190 EOLIAN_DOC_TOKEN_UNKNOWN = -1, 192 EOLIAN_DOC_TOKEN_UNKNOWN = 0,
191 EOLIAN_DOC_TOKEN_TEXT, 193 EOLIAN_DOC_TOKEN_TEXT,
192 EOLIAN_DOC_TOKEN_REF, 194 EOLIAN_DOC_TOKEN_REF,
193 EOLIAN_DOC_TOKEN_MARK_NOTE, 195 EOLIAN_DOC_TOKEN_MARK_NOTE,
@@ -433,9 +435,10 @@ end
433cutil.init_module(init, shutdown) 435cutil.init_module(init, shutdown)
434 436
435M.object_scope = { 437M.object_scope = {
436 PUBLIC = 0, 438 UNKNOWN = 0,
437 PRIVATE = 1, 439 PUBLIC = 1,
438 PROTECTED = 2 440 PRIVATE = 2,
441 PROTECTED = 3
439} 442}
440 443
441M.directory_scan = function(dir) 444M.directory_scan = function(dir)
@@ -479,12 +482,12 @@ M.database_validate = function()
479end 482end
480 483
481M.declaration_type = { 484M.declaration_type = {
482 UNKNOWN = -1, 485 UNKNOWN = 0,
483 CLASS = 0, 486 CLASS = 0,
484 ALIAS = 1, 487 ALIAS = 1,
485 STRUCT = 2, 488 STRUCT = 2,
486 ENUM = 3, 489 ENUM = 3,
487 VAR = 4 490 VAR = 4
488} 491}
489 492
490M.type_type = { 493M.type_type = {
@@ -849,9 +852,10 @@ M.Function = ffi.metatype("Eolian_Function", {
849}) 852})
850 853
851M.parameter_dir = { 854M.parameter_dir = {
852 IN = 0, 855 UNKNOWN = 0,
853 OUT = 1, 856 IN = 1,
854 INOUT = 2 857 OUT = 2,
858 INOUT = 3
855} 859}
856 860
857ffi.metatype("Eolian_Function_Parameter", { 861ffi.metatype("Eolian_Function_Parameter", {
@@ -1271,39 +1275,39 @@ M.Value = ffi.metatype("Eolian_Value", {
1271}) 1275})
1272 1276
1273M.binary_operator = { 1277M.binary_operator = {
1274 INVALID = -1, 1278 INVALID = 0,
1275 1279
1276 ADD = 0, 1280 ADD = 1,
1277 SUB = 1, 1281 SUB = 2,
1278 MUL = 2, 1282 MUL = 3,
1279 DIV = 3, 1283 DIV = 4,
1280 MOD = 4, 1284 MOD = 5,
1281 1285
1282 EQ = 5, 1286 EQ = 6,
1283 NQ = 6, 1287 NQ = 7,
1284 GT = 7, 1288 GT = 8,
1285 LT = 8, 1289 LT = 9,
1286 GE = 9, 1290 GE = 10,
1287 LE = 10, 1291 LE = 11,
1288 1292
1289 AND = 11, 1293 AND = 12,
1290 OR = 12, 1294 OR = 13,
1291 1295
1292 BAND = 13, 1296 BAND = 14,
1293 BOR = 14, 1297 BOR = 15,
1294 BXOR = 15, 1298 BXOR = 16,
1295 LSH = 16, 1299 LSH = 17,
1296 RSH = 17 1300 RSH = 18
1297} 1301}
1298 1302
1299M.unary_operator = { 1303M.unary_operator = {
1300 INVALID = -1, 1304 INVALID = 0,
1301 1305
1302 UNM = 0, 1306 UNM = 1,
1303 UNP = 1, 1307 UNP = 2,
1304 1308
1305 NOT = 2, 1309 NOT = 3,
1306 BNOT = 3 1310 BNOT = 4
1307} 1311}
1308 1312
1309M.Expression = ffi.metatype("Eolian_Expression", { 1313M.Expression = ffi.metatype("Eolian_Expression", {
@@ -1523,14 +1527,14 @@ M.Documentation = ffi.metatype("Eolian_Documentation", {
1523}) 1527})
1524 1528
1525M.doc_token_type = { 1529M.doc_token_type = {
1526 UNKNOWN = -1, 1530 UNKNOWN = 0,
1527 TEXT = 0, 1531 TEXT = 1,
1528 REF = 1, 1532 REF = 2,
1529 MARK_NOTE = 2, 1533 MARK_NOTE = 3,
1530 MARK_WARNING = 3, 1534 MARK_WARNING = 4,
1531 MARK_REMARK = 4, 1535 MARK_REMARK = 5,
1532 MARK_TODO = 5, 1536 MARK_TODO = 6,
1533 MARKUP_MONOSPACE = 6 1537 MARKUP_MONOSPACE = 7
1534} 1538}
1535 1539
1536M.doc_ref_type = { 1540M.doc_ref_type = {
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 7368921..7e687ee 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -182,7 +182,8 @@ typedef enum
182 182
183typedef enum 183typedef enum
184{ 184{
185 EOLIAN_IN_PARAM = 0, 185 EOLIAN_UNKNOWN_PARAM = 0,
186 EOLIAN_IN_PARAM,
186 EOLIAN_OUT_PARAM, 187 EOLIAN_OUT_PARAM,
187 EOLIAN_INOUT_PARAM 188 EOLIAN_INOUT_PARAM
188} Eolian_Parameter_Dir; 189} Eolian_Parameter_Dir;
@@ -198,7 +199,8 @@ typedef enum
198 199
199typedef enum 200typedef enum
200{ 201{
201 EOLIAN_SCOPE_PUBLIC = 0, 202 EOLIAN_SCOPE_UNKNOWN = 0,
203 EOLIAN_SCOPE_PUBLIC,
202 EOLIAN_SCOPE_PRIVATE, 204 EOLIAN_SCOPE_PRIVATE,
203 EOLIAN_SCOPE_PROTECTED 205 EOLIAN_SCOPE_PROTECTED
204} Eolian_Object_Scope; 206} Eolian_Object_Scope;
@@ -291,7 +293,7 @@ typedef struct _Eolian_Value
291 293
292typedef enum 294typedef enum
293{ 295{
294 EOLIAN_BINOP_INVALID = -1, 296 EOLIAN_BINOP_INVALID = 0,
295 297
296 EOLIAN_BINOP_ADD, /* + int, float */ 298 EOLIAN_BINOP_ADD, /* + int, float */
297 EOLIAN_BINOP_SUB, /* - int, float */ 299 EOLIAN_BINOP_SUB, /* - int, float */
@@ -318,7 +320,7 @@ typedef enum
318 320
319typedef enum 321typedef enum
320{ 322{
321 EOLIAN_UNOP_INVALID = -1, 323 EOLIAN_UNOP_INVALID = 0,
322 324
323 EOLIAN_UNOP_UNM, /* - sint */ 325 EOLIAN_UNOP_UNM, /* - sint */
324 EOLIAN_UNOP_UNP, /* + sint */ 326 EOLIAN_UNOP_UNP, /* + sint */
@@ -329,7 +331,7 @@ typedef enum
329 331
330typedef enum 332typedef enum
331{ 333{
332 EOLIAN_DECL_UNKNOWN = -1, 334 EOLIAN_DECL_UNKNOWN = 0,
333 EOLIAN_DECL_CLASS, 335 EOLIAN_DECL_CLASS,
334 EOLIAN_DECL_ALIAS, 336 EOLIAN_DECL_ALIAS,
335 EOLIAN_DECL_STRUCT, 337 EOLIAN_DECL_STRUCT,
@@ -339,7 +341,7 @@ typedef enum
339 341
340typedef enum 342typedef enum
341{ 343{
342 EOLIAN_DOC_TOKEN_UNKNOWN = -1, 344 EOLIAN_DOC_TOKEN_UNKNOWN = 0,
343 EOLIAN_DOC_TOKEN_TEXT, 345 EOLIAN_DOC_TOKEN_TEXT,
344 EOLIAN_DOC_TOKEN_REF, 346 EOLIAN_DOC_TOKEN_REF,
345 EOLIAN_DOC_TOKEN_MARK_NOTE, 347 EOLIAN_DOC_TOKEN_MARK_NOTE,
diff --git a/src/lib/eolian/database_event_api.c b/src/lib/eolian/database_event_api.c
index 5d69041..0bd4acc 100644
--- a/src/lib/eolian/database_event_api.c
+++ b/src/lib/eolian/database_event_api.c
@@ -29,7 +29,7 @@ eolian_event_documentation_get(const Eolian_Event *event)
29EAPI Eolian_Object_Scope 29EAPI Eolian_Object_Scope
30eolian_event_scope_get(const Eolian_Event *event) 30eolian_event_scope_get(const Eolian_Event *event)
31{ 31{
32 EINA_SAFETY_ON_NULL_RETURN_VAL(event, EOLIAN_SCOPE_PUBLIC); 32 EINA_SAFETY_ON_NULL_RETURN_VAL(event, EOLIAN_SCOPE_UNKNOWN);
33 return event->scope; 33 return event->scope;
34} 34}
35 35
diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c
index 6266ca4..6d7d347 100644
--- a/src/lib/eolian/database_function_api.c
+++ b/src/lib/eolian/database_function_api.c
@@ -8,25 +8,25 @@
8EAPI Eolian_Object_Scope 8EAPI Eolian_Object_Scope
9eolian_function_scope_get(const Eolian_Function *fid, Eolian_Function_Type ftype) 9eolian_function_scope_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
10{ 10{
11 EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EOLIAN_SCOPE_PUBLIC); 11 EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EOLIAN_SCOPE_UNKNOWN);
12 EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, EOLIAN_SCOPE_PUBLIC); 12 EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, EOLIAN_SCOPE_UNKNOWN);
13 EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, EOLIAN_SCOPE_PUBLIC); 13 EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, EOLIAN_SCOPE_UNKNOWN);
14 switch (ftype) 14 switch (ftype)
15 { 15 {
16 case EOLIAN_METHOD: 16 case EOLIAN_METHOD:
17 if (fid->type != EOLIAN_METHOD) 17 if (fid->type != EOLIAN_METHOD)
18 return EOLIAN_SCOPE_PUBLIC; 18 return EOLIAN_SCOPE_UNKNOWN;
19 return fid->get_scope; 19 return fid->get_scope;
20 case EOLIAN_PROP_GET: 20 case EOLIAN_PROP_GET:
21 if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY)) 21 if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY))
22 return EOLIAN_SCOPE_PUBLIC; 22 return EOLIAN_SCOPE_UNKNOWN;
23 return fid->get_scope; 23 return fid->get_scope;
24 case EOLIAN_PROP_SET: 24 case EOLIAN_PROP_SET:
25 if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY)) 25 if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY))
26 return EOLIAN_SCOPE_PUBLIC; 26 return EOLIAN_SCOPE_UNKNOWN;
27 return fid->set_scope; 27 return fid->set_scope;
28 default: 28 default:
29 return EOLIAN_SCOPE_PUBLIC; 29 return EOLIAN_SCOPE_UNKNOWN;
30 } 30 }
31} 31}
32 32
diff --git a/src/lib/eolian/database_function_parameter_api.c b/src/lib/eolian/database_function_parameter_api.c
index 4835d09..34100ef 100644
--- a/src/lib/eolian/database_function_parameter_api.c
+++ b/src/lib/eolian/database_function_parameter_api.c
@@ -8,7 +8,7 @@
8EAPI Eolian_Parameter_Dir 8EAPI Eolian_Parameter_Dir
9eolian_parameter_direction_get(const Eolian_Function_Parameter *param) 9eolian_parameter_direction_get(const Eolian_Function_Parameter *param)
10{ 10{
11 EINA_SAFETY_ON_NULL_RETURN_VAL(param, EOLIAN_IN_PARAM); 11 EINA_SAFETY_ON_NULL_RETURN_VAL(param, EOLIAN_UNKNOWN_PARAM);
12 return param->param_dir; 12 return param->param_dir;
13} 13}
14 14
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index e3d72c4..4173877 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -270,7 +270,7 @@ get_binop_id(int tok)
270 case TOK_LSH: return EOLIAN_BINOP_LSH; 270 case TOK_LSH: return EOLIAN_BINOP_LSH;
271 case TOK_RSH: return EOLIAN_BINOP_RSH; 271 case TOK_RSH: return EOLIAN_BINOP_RSH;
272 272
273 default: return -1; 273 default: return EOLIAN_BINOP_INVALID;
274 } 274 }
275} 275}
276 276
@@ -284,11 +284,13 @@ get_unop_id(int tok)
284 case '!': return EOLIAN_UNOP_NOT; 284 case '!': return EOLIAN_UNOP_NOT;
285 case '~': return EOLIAN_UNOP_BNOT; 285 case '~': return EOLIAN_UNOP_BNOT;
286 286
287 default: return -1; 287 default: return EOLIAN_UNOP_INVALID;
288 } 288 }
289} 289}
290 290
291static const int binprec[] = { 291static const int binprec[] = {
292 -1, /* invalid */
293
292 8, /* + */ 294 8, /* + */
293 8, /* - */ 295 8, /* - */
294 9, /* * */ 296 9, /* * */
@@ -314,13 +316,6 @@ static const int binprec[] = {
314 316
315#define UNARY_PRECEDENCE 10 317#define UNARY_PRECEDENCE 10
316 318
317static int
318get_binop_prec(Eolian_Binary_Operator id)
319{
320 if (id < 0) return -1;
321 return binprec[id];
322}
323
324static Eolian_Expression *parse_expr_bin(Eo_Lexer *ls, int min_prec); 319static Eolian_Expression *parse_expr_bin(Eo_Lexer *ls, int min_prec);
325static Eolian_Expression *parse_expr(Eo_Lexer *ls); 320static Eolian_Expression *parse_expr(Eo_Lexer *ls);
326 321
@@ -329,7 +324,7 @@ parse_expr_simple(Eo_Lexer *ls)
329{ 324{
330 Eolian_Expression *expr; 325 Eolian_Expression *expr;
331 Eolian_Unary_Operator unop = get_unop_id(ls->t.token); 326 Eolian_Unary_Operator unop = get_unop_id(ls->t.token);
332 if (unop >= 0) 327 if (unop != EOLIAN_UNOP_INVALID)
333 { 328 {
334 int line = ls->line_number, col = ls->column; 329 int line = ls->line_number, col = ls->column;
335 eo_lexer_get(ls); 330 eo_lexer_get(ls);
@@ -436,8 +431,8 @@ parse_expr_bin(Eo_Lexer *ls, int min_prec)
436 { 431 {
437 Eolian_Expression *rhs, *bin; 432 Eolian_Expression *rhs, *bin;
438 Eolian_Binary_Operator op = get_binop_id(ls->t.token); 433 Eolian_Binary_Operator op = get_binop_id(ls->t.token);
439 int prec = get_binop_prec(op); 434 int prec = binprec[op];
440 if ((op < 0) || (prec < 0) || (prec < min_prec)) 435 if ((op == EOLIAN_BINOP_INVALID) || (prec < 0) || (prec < min_prec))
441 break; 436 break;
442 eo_lexer_get(ls); 437 eo_lexer_get(ls);
443 rhs = parse_expr_bin(ls, prec + 1); 438 rhs = parse_expr_bin(ls, prec + 1);
@@ -1073,6 +1068,7 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
1073 Eina_Bool has_nonull = EINA_FALSE, has_optional = EINA_FALSE, 1068 Eina_Bool has_nonull = EINA_FALSE, has_optional = EINA_FALSE,
1074 has_nullable = EINA_FALSE; 1069 has_nullable = EINA_FALSE;
1075 Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter)); 1070 Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter));
1071 par->param_dir = EOLIAN_IN_PARAM;
1076 FILL_BASE(par->base, ls, ls->line_number, ls->column); 1072 FILL_BASE(par->base, ls, ls->line_number, ls->column);
1077 *params = eina_list_append(*params, par); 1073 *params = eina_list_append(*params, par);
1078 if (allow_inout && ls->t.kw == KW_at_in) 1074 if (allow_inout && ls->t.kw == KW_at_in)
@@ -1321,6 +1317,7 @@ parse_property(Eo_Lexer *ls)
1321 prop = calloc(1, sizeof(Eolian_Function)); 1317 prop = calloc(1, sizeof(Eolian_Function));
1322 prop->klass = ls->tmp.kls; 1318 prop->klass = ls->tmp.kls;
1323 prop->type = EOLIAN_UNRESOLVED; 1319 prop->type = EOLIAN_UNRESOLVED;
1320 prop->get_scope = prop->set_scope = EOLIAN_SCOPE_PUBLIC;
1324 FILL_BASE(prop->base, ls, ls->line_number, ls->column); 1321 FILL_BASE(prop->base, ls, ls->line_number, ls->column);
1325 ls->tmp.kls->properties = eina_list_append(ls->tmp.kls->properties, prop); 1322 ls->tmp.kls->properties = eina_list_append(ls->tmp.kls->properties, prop);
1326 check(ls, TOK_VALUE); 1323 check(ls, TOK_VALUE);
@@ -1406,6 +1403,7 @@ parse_method(Eo_Lexer *ls)
1406 meth = calloc(1, sizeof(Eolian_Function)); 1403 meth = calloc(1, sizeof(Eolian_Function));
1407 meth->klass = ls->tmp.kls; 1404 meth->klass = ls->tmp.kls;
1408 meth->type = EOLIAN_METHOD; 1405 meth->type = EOLIAN_METHOD;
1406 meth->get_scope = meth->set_scope = EOLIAN_SCOPE_PUBLIC;
1409 FILL_BASE(meth->base, ls, ls->line_number, ls->column); 1407 FILL_BASE(meth->base, ls, ls->line_number, ls->column);
1410 ls->tmp.kls->methods = eina_list_append(ls->tmp.kls->methods, meth); 1408 ls->tmp.kls->methods = eina_list_append(ls->tmp.kls->methods, meth);
1411 check(ls, TOK_VALUE); 1409 check(ls, TOK_VALUE);
@@ -1692,6 +1690,7 @@ parse_event(Eo_Lexer *ls)
1692{ 1690{
1693 Eolian_Event *ev = calloc(1, sizeof(Eolian_Event)); 1691 Eolian_Event *ev = calloc(1, sizeof(Eolian_Event));
1694 FILL_BASE(ev->base, ls, ls->line_number, ls->column); 1692 FILL_BASE(ev->base, ls, ls->line_number, ls->column);
1693 ev->scope = EOLIAN_SCOPE_PUBLIC;
1695 Eina_Strbuf *buf = push_strbuf(ls); 1694 Eina_Strbuf *buf = push_strbuf(ls);
1696 ls->tmp.kls->events = eina_list_append(ls->tmp.kls->events, ev); 1695 ls->tmp.kls->events = eina_list_append(ls->tmp.kls->events, ev);
1697 check(ls, TOK_VALUE); 1696 check(ls, TOK_VALUE);
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 2bb2122..1d471a0 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -226,7 +226,7 @@ struct _Eolian_Event
226 Eolian_Documentation *doc; 226 Eolian_Documentation *doc;
227 Eolian_Type *type; 227 Eolian_Type *type;
228 Eolian_Class *klass; 228 Eolian_Class *klass;
229 int scope; 229 Eolian_Object_Scope scope;
230 Eina_Bool is_beta :1; 230 Eina_Bool is_beta :1;
231 Eina_Bool is_hot :1; 231 Eina_Bool is_hot :1;
232 Eina_Bool is_restart :1; 232 Eina_Bool is_restart :1;
diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua
index 7c86d34..ed309bd 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -12,6 +12,7 @@ local M = {}
12 12
13M.Node = util.Object:clone { 13M.Node = util.Object:clone {
14 scope = { 14 scope = {
15 UNKNOWN = eolian.object_scope.UNKNOWN,
15 PUBLIC = eolian.object_scope.PUBLIC, 16 PUBLIC = eolian.object_scope.PUBLIC,
16 PRIVATE = eolian.object_scope.PRIVATE, 17 PRIVATE = eolian.object_scope.PRIVATE,
17 PROTECTED = eolian.object_scope.PROTECTED 18 PROTECTED = eolian.object_scope.PROTECTED
@@ -408,6 +409,7 @@ M.Function = Node:clone {
408} 409}
409 410
410M.Parameter = Node:clone { 411M.Parameter = Node:clone {
412 UNKNOWN = eolian.param_dir.UNKNOWN,
411 IN = eolian.parameter_dir.IN, 413 IN = eolian.parameter_dir.IN,
412 OUT = eolian.parameter_dir.OUT, 414 OUT = eolian.parameter_dir.OUT,
413 INOUT = eolian.parameter_dir.INOUT, 415 INOUT = eolian.parameter_dir.INOUT,
@@ -427,7 +429,8 @@ M.Parameter = Node:clone {
427 [self.OUT] = "out", 429 [self.OUT] = "out",
428 [self.INOUT] = "inout" 430 [self.INOUT] = "inout"
429 } 431 }
430 return dir_to_str[self:direction_get()] 432 return assert(dir_to_str[self:direction_get()],
433 "unknown parameter direction")
431 end, 434 end,
432 435
433 type_get = function(self) 436 type_get = function(self)